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

Support for drag and drop synthetic events #592

Open
evbo opened this issue Sep 10, 2022 · 2 comments
Open

Support for drag and drop synthetic events #592

evbo opened this issue Sep 10, 2022 · 2 comments

Comments

@evbo
Copy link

evbo commented Sep 10, 2022

I can probably submit a PR eventually, but just wanted to capture this in case someone has a fix already!

drag and drop is of course a stunner HTML5 delivered and my understanding is you need access to types similar to ClipBoard events, e.g.:

.dataTransfer.files

For reference, I'm not seeing a drag/drop "dataTransfer" js.native for MouseEvent:

https://github.com/shadaj/slinky/blob/b1e7e021802d1503684f6db40aca9ed4ea80320c/web/src/main/scala/slinky/web/SyntheticMouseEvent.scala

So these should be added to MouseEvent

@evbo
Copy link
Author

evbo commented Sep 10, 2022

@shadaj would you prefer we just piggy back on the existing MouseEvent or would you like to break things up by context, such as creating a separate DragEvent as shown here?:
https://www.programcreek.com/scala/org.scalajs.dom.raw.Event

@shadaj
Copy link
Owner

shadaj commented Sep 12, 2022

I guess the primary authority on this is React's synthetic events. I don't see a specific type for drag events, so using MouseEvent would probably be the way to go.

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

2 participants