New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 642214 link

Starred by 11 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug


Show other hotlists

Hotlists containing this issue:
Nice-to-haves-for-Project-V


Sign in to add a comment

mouse wheel doesn't scroll scrollable element during drag/drop

Reported by pie...@gmail.com, Aug 30 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

Example URL:
http://codepen.io/anon/pen/vXBONZ

Steps to reproduce the problem:
1. hover over the scrollable DIV. use the mouse wheel to scroll up & down.
2. drag the 'drag' SPAN slowly toward the bottom of the scrolling DIV. notice how it scrolls the div automatically when you reach the bottom edge of the DIV.
3. however, when you're dragging, the mouse wheel does not work.

What is the expected behavior?
the mouse wheel should scroll the div, even when dragging.

What went wrong?
doesn't scroll

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? N/A 

Chrome version: 52.0.2743.116  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 22.0 r0
 

Comment 1 by e...@chromium.org, Aug 30 2016

Components: -Blink Blink>Input
Cc: dtapu...@chromium.org tdres...@chromium.org
Components: Blink>DataTransfer
Labels: -OS-Windows OS-All
Owner: dcheng@chromium.org
Status: Assigned (was: Unconfirmed)
This is certainly the case and it is not limited to Windows. The same happens on Mac.

I am not sure what is the right UX here and if we actually want to dispatch events during D&D operation. Safari does dispatch wheel event and scroll even during dispatch. dcheng@ do you have any insight on the right behaviour here?
FYI, firefox is also dispatches wheel event while dragging.
I think we should probably dispatch the events while dragging.

Comment 5 by dcheng@chromium.org, Sep 15 2016

Well, in 6.7.5, it does say:

From the moment that the user agent is to initiate the drag-and-drop operation, until the end of the drag-and-drop operation, device input events (e.g. mouse and keyboard events) must be suppressed.

So according to the spec, we're technically correct. But I'm not sure what behavior is more useful for web devs...

How does Edge handle this?

Comment 7 by pie...@gmail.com, Sep 15 2016

yeah, i think there's a bit of a misunderstanding here.

i'm not expecting DOM events to be fired from the wheel during DND.

I'm just saying that since:
1) DOM events _aren't_ fired for mouse move during DND (as per spec), AND
2) the mouse move over the scrollable DIV during DND causes it to scroll (again, without events, per spec)

it follows that the mouse wheel, during DND, could ALSO be used to scroll the DIV (again, without events).

this is just a suggestion to add another way for the user to scroll the DIV during DND. personally, i hate the 2nd-order accelerating scroll-when-near-the edge UI, especially when I have a perfectly good wheel under my middle finger.

Comment 8 by bokan@chromium.org, Apr 13 2017

Cc: ymalik@chromium.org bokan@chromium.org
 Issue 556169  has been merged into this issue.

Comment 9 by bokan@chromium.org, Apr 13 2017

Cc: sunyunjia@chromium.org
Labels: -Pri-2 Hotlist-Input-Dev Pri-3
Re #7, we can't just scroll without dispatching events to the page or else we'd break legitimate cases. I can imagine pages that block scrolling (e.g. while showing a modal dialog) using preventDefault on wheel/touch events that would break with the change you propose. Granted, those are broken today by drag and drop autoscroll :)

I think scrolling while dragging would be a nice behavior but given that there's consistency between browsers on this - we'd want to get concensus and change the spec. I suspect the intent behind the spec is really just to prevent firing mouse moves and changing hover so we could probably loosen the restriction. 

dcheng@, it probably makes sense for input-dev to own this. Mind if we take it off your hands?

Comment 10 by bokan@chromium.org, Apr 13 2017

 Issue 709783  has been merged into this issue.

Comment 11 by pie...@gmail.com, Apr 13 2017

re #9. what do you mean by "we can't just scroll without dispatching events to the page" ?

if you had tried my test case in OP you would see that is DOES ALREADY scroll without dispatching events during drag/drop.

I specifically called this out in #7:
"2) the mouse move over the scrollable DIV during DND causes it to scroll (again, without events, per spec)"

please take a minute to try the test case, read the OP and my comments (especially #7) again thoroughly.

so, again:
1) the browser _currently_ allows scrolling during DND without sending events.
2) I'm just suggesting adding the scroll-wheel as ANOTHER mechanism to allow this (in-DND, non-event-firing) scrolling.

Comment 12 by bokan@chromium.org, Apr 13 2017

Yes, I'm aware that we currently scroll on drag. What I'm saying is that allowing scroll on wheels without first sending a gesture is breaking the contract we have with the page. Given that there's consistent behavior across browsers, it's not something that we should unilaterally change.

We've had complaints in other bugs that there's no way to prevent scrolling on drag. Rather than make wheels non preventable to match DND, I'd rather make DND also fire events that can be prevented and allow wheel events during a drag. I believe the intent in the spec is to prevent the drag from activating hover and other effects on the page. It would probably be ok to allow wheel events. 
Chrome has a unique behaviour (Mac), Safari and Firefox don't prevent scrolling when dragging and they trigger wheel event while dragging.

https://codepen.io/anon/pen/ayKwxj?editors=1010

I found out this happens when an element on the page is position: fixed; or when there is an event listener on wheel.

For example, you can drag and scroll on this page : https://s.codepen.io/boomerang/iFrameKey-0cada2e6-c8ad-b0ed-20a9-37a116e842ef/index.html

But you can't on the pen edit page because there is some fixed elements :
https://codepen.io/anon/pen/gxKxYp?editors=1010

Chrome mac Version 60.0.3112.101

Comment 14 by bokan@chromium.org, Aug 23 2017

Cc: dcheng@chromium.org
Labels: Hotlist-Interop
Owner: sahel@chromium.org
Interesting, it seems Firefox's behavior varies by platform since that example doesn't scroll with drag-and-drop on Linux or Windows. Edge also doesn't scroll while drag and dropping. Whatever we do it'd be nice to make this work the same way across platforms (or at least clarify that it's a platform UX) as its a predictability issue otherwise.

I think allowing wheels during drag would probably be fine and low-ish risk since Safari already does it. But I'd want to get agreement from other vendors first and amend the spec to clarify that "device input events (e.g. mouse and keyboard events) must be suppressed." doesn't include wheel events. You could make an argument that you should be able to scroll with keyboard too, that seems more directly contradicted by the spec. I'm actually not sure why we block keyboard events while dragging, it doesn't seem like it'd be an issue.

Assigning to sahel@ to track this but we probably wont get to it this quarter.

Sign in to add a comment