Skip to content

Refresh DataTransfer API #738

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

Closed
armanbilge opened this issue Nov 2, 2022 · 4 comments · Fixed by #763
Closed

Refresh DataTransfer API #738

armanbilge opened this issue Nov 2, 2022 · 4 comments · Fixed by #763
Assignees

Comments

@armanbilge
Copy link
Member

I think there are some changes. Also it can use the new FrozenArray type.

https://github.com/scala-js/scala-js-dom/blob/714813e31cf5838d9844141f7bc1b90275f79fa3/dom/src/main/scala/org/scalajs/dom/DataTransfer.scala

https://html.spec.whatwg.org/multipage/dnd.html#datatransfer

@zetashift
Copy link
Contributor

I have a question concerning effectAllowed and dropEffect. They return enums form the spec

The dropEffect attribute controls the drag-and-drop feedback that the user is given during a drag-and-drop operation. When the DataTransfer object is created, the dropEffect attribute is set to a string value. On getting, it must return its current value. On setting, if the new value is one of "none", "copy", "link", or "move", then the attribute's current value must be set to the new value. Other values must be ignored.

The effectAllowed attribute is used in the drag-and-drop processing model to initialize the dropEffect attribute during the dragenter and dragover events. When the DataTransfer object is created, the effectAllowed attribute is set to a string value. On getting, it must return its current value. On setting, if drag data store's mode is the read/write mode and the new value is one of "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", or "uninitialized", then the attribute's current value must be set to the new value. Otherwise it must be left unchanged.

But how do I name these things lol, EffectAllowedTypes and DropEffectTypes? or Kinds instead of types?

@armanbilge
Copy link
Member Author

armanbilge commented Jan 29, 2023

Hmmm 😂 I see TypeScript is no help here.

https://github.com/microsoft/TypeScript/blob/7d1cc88a8cbdf8aa847a7f2a7d4bfeb89c8dde15/lib/lib.dom.d.ts#L4302-L4318

erm ... IDK. DropEffectOperation ? but EffectAllowedOperation seems weird.

I wonder if just DropEffect and EffectAllowed could be okay.

@zetashift
Copy link
Contributor

zetashift commented Jan 29, 2023

DropEffectValue and EffectAllowedValue?

I'm also okay with DropEffect and EffectAllowed!

@armanbilge
Copy link
Member Author

/shrug if you don't mind open the PR with anything and then let me bikeshed it for 6 months 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants