sean-codes / atom-browser

Atom-Browser is the plugin to browse the web, preview files, auto-reload, and search Google within Atom
MIT License
39 stars 7 forks source link

No touch simulation on click and drag #23

Closed ShapeGroup closed 5 years ago

ShapeGroup commented 5 years ago

Really nice but .. do you have a touch simulation inside?? because I am trying to test the interface of the my app (web) and does not take the drag (obviously chrome firefox yes, it is certain that the system works).

thanks.

sean-codes commented 5 years ago

@ShapeGroup thanks for opening an issue! Would you mind providing an example I could test? I tried with the dragula front page and was able to drag and drop.

drag-and-drop-within-atom-browser

ShapeGroup commented 5 years ago

Because the drag is based on mouse events and not collective. To test a cross-app, you need to enter debug mode (F12 (or Ctrl+shift+M directly for touch simulation in firefox) ) and click on the simulate touch .

Obviously I will try as soon as I can to provide.

In any case: you can test by trying ontouchstart or move, to understand that the event, apparently, is not taken in any way.

I will shortly provide code ;)

little rapid exemple:

mydiv.ontouchstart = event => { do... } mydiv.ontouchmove = event => { do... } mydiv.ontouchend = event => { do... }

or mydiv.ontouchstart = dragStart; // in cross-app mydiv.onmousedown = dragStart; // web

mydiv.ontouchmove = dragMove; // in cross-app mydiv.ondrag = dragMove; // web

mydiv.ontouchend = dragEnd; // in cross-app mydiv.onmouseup = dragEnd; // web

function dragStart(){ do... } function dragMove(){ do... } function dragEnd(){ do... }

sean-codes commented 5 years ago

@ShapeGroup Ah okay! I think this might have been brought up before in the past. atom-browser uses an electron webview and the events / devtools available are provided through there.

The mobile button (deviceEmulation) that you might find in firefox/chrome seems is not available. :( Screen Shot 2019-11-11 at 8 54 15 AM

Additional information: https://github.com/electron/electron/issues/5488 https://electronjs.org/docs/api/webview-tag