Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulated touch based DnD not working in Chrome/Chromium based browsers #4155

Open
wridgeu opened this issue Oct 23, 2024 · 1 comment
Open
Assignees

Comments

@wridgeu
Copy link
Contributor

wridgeu commented Oct 23, 2024

OpenUI5 version: latest (1.129)

Browser/version (+device/version):

  • Device: regular desktop browser (windows 11...)
  • Browser: Chrome Version 130.0.6723.70, other Chromium based (Edge): Version 130.0.2849.52 (Official build) (64-bit)

Any other tested browsers/devices(OK/FAIL):

  • FAIL: Chromium based i.e. Edge, Chrome
  • OK: Firefox (with one limitation: the touch simulation must be turned off(?) which seems counter-intuitive)
    image

❗Disclaimer: based on the explanation here it would lead me to believe that it is also not correctly working in firefox(?) as it being enabled should then properly "translate mouse events into touch events." Which, if it is, does not work in ff then either. Though, when disabled, the fired events on the UI5 controls/item itself seem reasonable ...

URL (minimal example if possible):
DnD Samples, while found within sap.m.Tree, it does not matter I think:

User/password (if required and possible - do not post any confidential information here):
N/A

Steps to reproduce the problem:

  1. Open up the application/demo
  2. Try to simulate a touch-based device (hard refresh if you must)
  3. Try drag 'n drop on your desktop

What is the expected result?
Working simulation for DnD to test, prototype and well all sort of thing you'd want DnD for ...

What happens instead?
Seems like the only "interesting" events that are triggered are scroll events (i.e. the touch/drag is interpreted as scroll?), at least in the chromium based browsers.

Any other information? (attach screenshot if possible)
⚠️This might, as described (+ mentioned in the title), not be a direct issue with UI5 itself but I've stumbled across similar touch issues in the past where you helped out opening an issue to chrome directly maybe this is another one of these lucky cases. If so I apologize for raising this here but still hope for someone can give a helping hand and once again raise this to the place where appropriate. ⚠️

Within chrome itself various options were tested:

  • going into "Sensors" and forcing touch like so
    image
  • checking experimental flags like
    image
  • also checked other places, settings (like in older versions of chrome the "Rendering" tab and so forth ..)
  • trying out different device types, even desktop + touch didn't seem to work
    image
    ... all to no avail.

Here are also some quick screencasts thanks to @dfenerski for chrome & ff:

For a quick test in the sap.m.Tree sample, feel free to copy/paste (and remove uninteresting events):

item = sap.ui.getCore().byId('__item0-__xmlview0--Tree-1')

item.addEventDelegate({
    onclick: () => { console.error('CLICK') },
    ondblclick: () => { console.error('DOUBLE CLICK') },
    oncontextmenu: () => { console.error('CONTEXT MENU') },
    onfocus: () => { console.error('FOCUS IN') },
    onkeydown: () => { console.error('KEY DOWN') },
    onkeypress: () => { console.error('KEY PRESS') },
    onkeyup: () => { console.error('KEY UP') },
    onmousedown: () => { console.error('MOUSE DOWN') },
    onmousemove: () => { console.error('MOUSE OUT') },
    onmouseout: () => { console.error('MOUSE OUT') },
    onmouseover: () => { console.error('MOUSE OVER') },
    onselect: () => { console.error('SELECT') },
    ondragstart: () => { console.error('DRAG START') },
    ondragenter: () => { console.error('DRAG ENTER') },
    ondragleave: () => { console.error('DRAG LEAVE') },
    ondragend: () => { console.error('DRAG END') },
    ondrop: () => { console.error('DROP') },
    onpaste: () => { console.error('PASTE') },
    oncut: () => { console.error('CUT') },
    ontouchstart: () => { console.error('TOUCH START') },
    ontouchmove: () => { console.error('TOUCH MOVE') },
    ontouchend: () => { console.error('TOUCH END') },
    ontouchcancel: () => { console.error('TOUCH CANCEL') },
    onswipe: () => { console.error('SWIPE') },
    onswipeleft: () => { console.error('SWIPE LEFT') },
    onscrollstart: () => { console.error('SCROLL START') },
    onscrollstop: () => { console.error('SCROLL STOP') }
})

Maybe I found something, maybe I'm testing it wrong or expecting the wrong thing to happen. Happy for any input here! :)

@DonkeyCo
Copy link
Member

I've created internal incident DINC0310607 for you.

I was able to reproduce the issue not only in the UI5 sample, but also in pure HTML samples (https://jsfiddle.net/domap6qL/1/ and https://mdn.github.io/dom-examples/drag-and-drop/copy-move-DataTransfer.html).

I'll look into opening a bug report in Chromium and will update the issue with a link to it once it has been filed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants