Get $event on drag-enter/drag-leave
See original GitHub issueI am having an issue grabbing the event from these handlers. They fire okay but I am not sure how to get the event.
@drag-enter="onDragEnter($event)"
function onDragEnter(e) {
console.log(e) //returns undefined
}
I’ve also tried adding vanilla events and they don’t seem to work. Even a click handler does not work. Is there a way I can get the event from those two drag events?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
HTMLElement: dragleave event - Web APIs | MDN
The dragleave event is fired when a dragged element or text selection leaves a valid drop target.
Read more >HTML5 dragleave fired when hovering a child element
Basically, it involves identifying and ignoring dragleave events which occur when dragging over child elements. Because the dragenter event is fired on child ......
Read more >ondragleave Event - W3Schools
The ondragleave event occurs when a draggable element or text selection leaves a valid drop target. ... Get the dragged data with the...
Read more >Control.DragLeave Event (System.Windows.Forms)
The DragLeave event is raised when the user drags the cursor out of the control or the user cancels the current drag-and-drop operation....
Read more >Active States with Drag Enter and Leave Events in JavaScript
For this, we're going to simply add an active class to the draggable area. For this, we'll need to hook into the dragenter...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@chrisdel101 drag-enter & drag-leave events don’t pass any parameters to handlers.
As for click handlers and other browser implemented events you can append .native to the event name:
@click.native="onClickHandler($event)"
@krsyoung For your case that’s what I would do too.
My first syntax only works if you have split the container into its own component.
For example, instead of:
You would need to do
Where my-component is: