Add drag event API binding#641
Merged
Merged
Conversation
Closed
5acb5df to
e0c92d9
Compare
davesnx
approved these changes
Dec 16, 2022
davesnx
left a comment
Member
There was a problem hiding this comment.
There hasn't been any reason why Drag wasn't part of reason-react. I left a small comment about dataTransfer, which has been the case for other events that expose Js.t instead of the opaque type.
I know that I'm reviewing this PR super late, but that's what we got. If there's no interest from your part, I'm happy to push it.
| [@bs.get] external screenY: t => int = "screenY"; | ||
| [@bs.get] external shiftKey: t => bool = "shiftKey"; | ||
|
|
||
| [@bs.get] external dataTransfer: t => Dom.dataTransfer = "dataTransfer"; |
Member
There was a problem hiding this comment.
Dom.dataTransfer is an opaque type, probably better to return Js.t({..}). Even though it's unsafe it's better to allow users to access by object accessor.
davesnx
pushed a commit
that referenced
this pull request
Dec 20, 2022
* feat(drag): add drag event API binding * feat(drag): update onDrag*/onDrop bindings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add and use a new
ReactEvent.Dragmodule foronDrag,onDrop, etc. The new module is likeReactEvent.Mousebut also includes a binding fordataTransfer.