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

Define events for drag-and-drop operations (textInput etc) #367

Open
zcorpan opened this issue Jan 29, 2024 · 1 comment
Open

Define events for drag-and-drop operations (textInput etc) #367

zcorpan opened this issue Jan 29, 2024 · 1 comment

Comments

@zcorpan
Copy link
Member

zcorpan commented Jan 29, 2024

See #362 (comment)

https://html.spec.whatwg.org/#drag-and-drop-processing-model defines the drag and drop model and some events, and refers to Pointer Events spec for some events.

When performing a drag and drop operation in an editing host (or dropping in an editing host), browsers fire textInput, beforeinput, mutation events, input -- which isn't currently defined as far as I can tell.

Interestingly, the event order in Chromium and WebKit is textInput and then beforeinput, which maybe should be the other way around for consistency with input from typing.

Demo: https://software.hixie.ch/utilities/js/live-dom-viewer/saved/11841

I think this should integrate somehow with this part of HTML:

If the current target element is a text control (e.g., textarea, or an input element whose type attribute is in the Text state) or an editing host or editable element, and the drag data store item list has an item with the drag data item type string "text/plain" and the drag data item kind text

Insert the actual data of the first item in the drag data store item list to have a drag data item type string of "text/plain" and a drag data item kind that is text into the text control or editing host or editable element in a manner consistent with platform-specific conventions (e.g. inserting it at the current mouse cursor position, or inserting it at the end of the field).

cc @masayuki-nakano

@zcorpan
Copy link
Member Author

zcorpan commented Feb 23, 2024

Interestingly, the event order in Chromium and WebKit is textInput and then beforeinput, which maybe should be the other way around for consistency with input from typing.

Gecko's behavior with @masayuki-nakano 's patch for https://bugzilla.mozilla.org/show_bug.cgi?id=903746 is beforeinput event then textInput. I've created a PR with a tentative test for this event order: web-platform-tests/wpt#44744

cc @sideshowbarker

zcorpan added a commit to web-platform-tests/wpt that referenced this issue Apr 3, 2024
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Apr 10, 2024
…ith drag and drop, a=testonly

Automatic update from web-platform-tests
UIEvents: Tentative test for textInput with drag and drop

See w3c/uievents#367
--

wpt-commits: ee2fe53bf4b960b90a072d65a57b56b797a61289
wpt-pr: 44744
ErichDonGubler pushed a commit to ErichDonGubler/firefox that referenced this issue Apr 15, 2024
…ith drag and drop, a=testonly

Automatic update from web-platform-tests
UIEvents: Tentative test for textInput with drag and drop

See w3c/uievents#367
--

wpt-commits: ee2fe53bf4b960b90a072d65a57b56b797a61289
wpt-pr: 44744
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant