New issue
Advanced search Search tips

Issue 613990 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Dragging over <select> incorrectly starts drag-and-drop

Reported by a...@scirra.com, May 23 2016

Issue description

UserAgent: 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.)
 

Comment 1 by a...@scirra.com, May 23 2016

Actually, I think it might be selecting the <canvas> fallback contents.

Comment 2 by japhet@chromium.org, May 23 2016

Components: -Blink Blink>Editing Blink>Forms>Select
Labels: -OS-Windows -Arch-x86_64 OS-All
Status: Untriaged (was: Unconfirmed)

Comment 3 by tkent@chromium.org, May 23 2016

Components: -Blink>Editing Blink>Input>HitTesting
Labels: Needs-Reduction
Status: Available (was: Untriaged)
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.

Comment 4 by tkent@chromium.org, May 23 2016

Labels: Hotlist-Interop
Cc: majidvp@chromium.org
I cannot reproduce this on Mac OS (using touchpad) with latest stable release M51. Does this still persist?

Comment 6 by tkent@chromium.org, Jun 10 2016

Labels: Needs-Feedback
I also can't reproduce the issue with M51 stable and M53 canary.
ash@, can you reproduce the problem now?

Comment 7 by phistuck@gmail.com, Jun 10 2016

I can reproduce this.
Chrome 51.0.2704.84 (Official Build) m (32-bit)
Windows 7 Enterprise
Components: -Blink>Input>HitTesting
Labels: -OS-All OS-Windows
Owner: dcheng@chromium.org
Status: Assigned (was: Available)
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.
trace_drag-canvas-issue.json.gz
1.4 MB Download

Comment 9 by dcheng@chromium.org, Jul 11 2016

Components: Blink>DataTransfer
Owner: yosin@chromium.org
It's probably a bug. yosin@, do you think someone on editing team could take a look at this?

Comment 10 by yosin@chromium.org, Jul 11 2016

Components: -Blink>DataTransfer -Blink>Forms>Select Blink>TextSelection
Labels: -Needs-Reduction -Needs-Feedback
Owner: ----
Status: Available (was: Assigned)
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.


Comment 11 by a...@scirra.com, Jul 11 2016

I tried adding a preventDefault() call in a "selectstart" event for the select element, and it didn't fix the problem.

Comment 12 by yosin@chromium.org, Jul 12 2016

ash@, could you upload your change? I would like to try it within debugger.
Thanks in advance.

Comment 13 by yosin@chromium.org, Jul 15 2016

Labels: Needs-Feedback

Comment 14 by a...@scirra.com, 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.

Comment 15 by tkent@chromium.org, Oct 12 2016

Components: -Blink>TextSelection Blink>Editing>Selection
Labels: Pri-3
Project Member

Comment 17 by sheriffbot@chromium.org, Oct 4

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
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
Status: Available (was: Untriaged)

Sign in to add a comment