Skip to content

Understanding Drag-and-Drop API in Lit (v3.0.0-pre.1) #4253

Answered by augustjk
Zearin asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry for the late reply on this. Maybe you've already figured it out but you're only seeing the dragstart event because the handler for that doe preventDefault() on the event, preventing any further events from firing.

Commenting out the evt.preventDefault() line firings all the events as you can see here.
See here: https://lit.dev/playground/#gist=31e8bf207039d1c302bacd2a7b9efadd

Alternatively, passing {passive: true} to the addEventListener() option would also make it ignore any attempts to prevent default.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Zearin
Comment options

Answer selected by Zearin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants