# Bug? mouseEnter/Exit don't trigger when the component is a DragAndDropTarget

**URL:** <https://forum.juce.com/t/bug-mouseenter-exit-dont-trigger-when-the-component-is-a-draganddroptarget/45051>\
**Category:** General JUCE discussion\
**Created:** [March 17, 2021, 9:55am UTC](https://forum.juce.com/t/bug-mouseenter-exit-dont-trigger-when-the-component-is-a-draganddroptarget/45051 "2021-03-17T09:55:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![asimilon](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/asimilon/32/4235_2.png) [@asimilon](https://forum.juce.com/u/asimilon)\
**Post date:** [March 17, 2021, 9:55am UTC](https://forum.juce.com/t/bug-mouseenter-exit-dont-trigger-when-the-component-is-a-draganddroptarget/45051/1 "2021-03-17T09:55:28Z")

</div>

I have a component that is a DragAndDropTarget, whenever something is being dragged over it the mouseEnter and mouseExit methods are never called, is this expected behaviour?

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [March 17, 2021, 10:08am UTC](https://forum.juce.com/t/bug-mouseenter-exit-dont-trigger-when-the-component-is-a-draganddroptarget/45051/2 "2021-03-17T10:08:02Z")

</div>

Do you get [itemDragEnter()](https://docs.juce.com/develop/classDragAndDropTarget.html#a116d963d936a6f1fff772d7d4bb6c811) and itemDragExit() instead?  
I guess DragAndDropTarget will snatch the mouseEnter and mouseExit, but haven’t checked.

Would be debatable if that is the correct behaviour though, I think it makes sense to be able to distinguish if you drag or normally enter the component.

---

<div class="post-metadata">

**Author:** ![asimilon](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/asimilon/32/4235_2.png) [@asimilon](https://forum.juce.com/u/asimilon)\
**Post date:** [March 17, 2021, 10:42am UTC](https://forum.juce.com/t/bug-mouseenter-exit-dont-trigger-when-the-component-is-a-draganddroptarget/45051/3 "2021-03-17T10:42:17Z")

</div>

> [@daniel](#):
>
> Do you get [itemDragEnter()](https://docs.juce.com/develop/classDragAndDropTarget.html#a116d963d936a6f1fff772d7d4bb6c811) and itemDragExit() instead?

Yes, it was exactly this, thank you @daniel 🙂
