0

Does anyone know a proper way to trigger mouseenter and mouseleave events while dragging in the Angular framework? I've looked through the docs and haven't found anything.

I've tried different aproaches that didn't work.

https://stackoverflow.com/a/40041496/3264998

https://stackoverflow.com/a/12270694/3264998

etc.

1

<div>(mouseover)="mouseEnter($event)" (mouseout)="mouseLeave($event)"</div>

<div>(mouseenter)="mouseEnter($event)" (mouseleave)="mouseLeave($event)"</div>


mouseEnter(event) {
        console.log("mouse enter" + event);
    }

mouseLeave(event) {
    console.log("mouse leave" + event);

}
Gerald Hughes
  • 5,771
  • 20
  • 73
  • 131

1 Answers1

0

Seems that this worked for me:

  1. The ondragenter event occurs when a draggable element or text selection enters a valid drop target. ( https://www.w3schools.com/jsref/event_ondragenter.asp )
  2. The ondragleave event occurs when a draggable element or text selection leaves a valid drop target. ( https://www.w3schools.com/jsref/event_ondragleave.asp )
Gerald Hughes
  • 5,771
  • 20
  • 73
  • 131