Dragging over <select> incorrectly starts drag-and-drop
Reported by
a...@scirra.com,
May 23 2016
|
||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36 Example URL: https://dl.dropboxusercontent.com/u/15217362/bugs/listboxbug/index.html Steps to reproduce the problem: 1. Open the given URL. 2. Click and drag the mouse side-to-side over the <select> list. Don't start or finish the drag over the <select>, just move the cursor over it while dragging. 3. Observe what happens the second time you pass over. What is the expected behavior? As per Firefox and Edge, the <select> should not start a drag-and-drop. The blue box should move to the cursor position when the mouse button is released. What went wrong? Despite not having focus, the contents of the <select> element starts a drag-and-drop. A faded version of its contents are dragged away and the cursor turns to a "not allowed" symbol. The blur box does not move to the cursor position when the mouse button is released. Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? Yes Chrome version: 50.0.2661.102 Channel: stable OS Version: 10.0 Flash Version: Shockwave Flash 21.0 r0 This affects the Construct 2 game engine and was first reported by a user here: https://www.scirra.com/forum/the-list-box-object-breaks-the-on-button-released-condition_t172399 Theory: the first drag-across does a "text-select" on some invisible contents of the <select>. The second drag then tries to do a drag-selected-text operation, but the list box does not have focus so this should not happen. (The focus can be verified by entering document.activeElement in the console and seeing it's <body>, and the blue focus outline style is also not applied to the list.)
,
May 23 2016
,
May 23 2016
Confirmed, but the page is too complex to identify the root cause. We need a more simpler reproduction. At least without jquery and c2runtime.js.
,
May 23 2016
,
Jun 9 2016
I cannot reproduce this on Mac OS (using touchpad) with latest stable release M51. Does this still persist?
,
Jun 10 2016
I also can't reproduce the issue with M51 stable and M53 canary. ash@, can you reproduce the problem now?
,
Jun 10 2016
I can reproduce this. Chrome 51.0.2704.84 (Official Build) m (32-bit) Windows 7 Enterprise
,
Jul 7 2016
OK, I can reproduce it on Linux. It went back as far as 46.0.2467.0 and it happens there too so it is not a regression but an existing bug. I checked and this is not a hit-testing bug. All hit-testing results seems to be correct. See attached trace for example. It does not seem to be dragging the canvas fallback content either but rather the whole document. There is a bit of code in |DragController| that walks ancestor chain that tries to find a suitable drag candidate which may be related to this. Assigning to dcheng@ to assess if this is a bug and assign to a suitable owner if necessary.
,
Jul 11 2016
It's probably a bug. yosin@, do you think someone on editing team could take a look at this?
,
Jul 11 2016
I could re-produce on Win 10. The root cause is c2runtime.js doesn't cancel "selectstart" for SELECT element. When mouse dragging over SELECT element, Selection::updateSelectionForMouseDrag() set selection to SELECT element and start dragging. It seems Firefox and Edge doesn't dispatch "selectstart" once canceled. The workaround is adding event handler for "selectstart" to SELECT element to cancel "selectstart". Here is possible changes in Blink: http://crrev.com/2140503002 Not sure this is right behavior or not.
,
Jul 11 2016
I tried adding a preventDefault() call in a "selectstart" event for the select element, and it didn't fix the problem.
,
Jul 12 2016
ash@, could you upload your change? I would like to try it within debugger. Thanks in advance.
,
Jul 15 2016
,
Aug 1 2016
Here is a variant which simply calls e.preventDefault() on the "selectstart" event on the select element: https://dl.dropboxusercontent.com/u/15217362/bugs/listboxbug2/index.html It seems to take a few more drags across the select element, but then the bug still reproduces.
,
Oct 12 2016
,
Oct 4 2017
,
Oct 4
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 5
|
||||||||||||||
►
Sign in to add a comment |
||||||||||||||
Comment 1 by a...@scirra.com
, May 23 2016