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

Could input events be allowed while dragging? #4794

Open
tontonsb opened this issue Jul 23, 2019 · 4 comments
Open

Could input events be allowed while dragging? #4794

tontonsb opened this issue Jul 23, 2019 · 4 comments
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: drag and drop

Comments

@tontonsb
Copy link

https://html.spec.whatwg.org/multipage/dnd.html#drag-and-drop-processing-model

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.

What is the reasoning for this? Are there any issues if it would be allowed to receive the press of key B?

A bad consequence of this restriction is that mousewheel can't be used to scroll pages or containers while dragging something.

I propose to at least allow mousewheel event. But I could also see use cases for other input. The user could grab an item out of the container, use keyboard shortcut to display another container and drop it in that one. Currently something like that would only be possible by catching dragover on some icon, just like scrolling is only achieved by dragging item close to the edge of the viewport.

P.S. Sorry if this has already been discussed. I couldn't find it in the tracker even though some bug reports refer to the standard - https://bugs.chromium.org/p/chromium/issues/detail?id=556169

@domenic
Copy link
Member

domenic commented Jul 29, 2019

I'm not sure what historically motivated this decision. At this point, browsers seem to be interoperable in that regard, so it sounds like we'd classify this as a feature request. I'd be curious to hear from browsers if there are architectural reasons for this behavior.

@domenic domenic added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: drag and drop labels Jul 29, 2019
@domenic
Copy link
Member

domenic commented Jul 30, 2019

Asking around a bit internally folks note that this behavior seems to match Windows, where no program allows scrolling or similar while dragging. But some preliminary reports say that on macOS you can scroll while dragging. Did you test on macOS? (I didn't, so the spec might not match reality there.)

@tontonsb
Copy link
Author

tontonsb commented Aug 5, 2019

I don't have any apple devices. However reading various reports it seems that most large browsers dispatch wheel events on macOS, except Chrome.

As a Win user I'd be more thrilled to see the ban lifted for all platforms. Users seem to expect wheel to work in browsers as it has always worked with custom d&d implementations.

this behavior seems to match Windows, where no program allows scrolling or similar while dragging

This seems to be the case for the Office suite and it makes some sense as you can always select, cut and paste. But scrolling while dragging works in Paint. And that makes sense as well - you can't point your cursor to a position on a page there, it always pastes to the topleft corner. So scrolling works in Windows when it's necessary.

Shouldn't it be up to website developers to decide if wheel (or any other) events while dragging are necessary for their app?

@LoveMeWithoutAll
Copy link

Wheel scroll behavior while dragging is very convenient for web developer. And now, many browser like chrome, edge, firefox, safari on MacOS(browsers of Windows OS does not support).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: drag and drop
Development

No branches or pull requests

3 participants