I have the current structure in React
var Component = React.createClass({
_testOver:function(){
console.log("Do action on hover");
},
_testOut: function(){
console.log("Do action on out");
},
render: function(){
return <div style={display:"none"}>
<div className="container"
onDragEnter={this._testOver}
onDragLeave={this._testOut}
style={{height:"400px",
paddingTop:"100px",
backgroundColor:"red"}}>
<div className= "child" style={{height:"200px",
backgroundColor:"blue"}}>
TESTING
</div>
</div>
</div>
}
});
When dragging something over the container, _testOver() event will fire. Hovever, when keep dragging onto the child, the _testOut() event will fire and at the same time, another _testOver() is fired.
I understand that it happens like that because technically the mouse is dragged out of the container and into the child (which is still inside the container, hence firing another _testOver() event)
My question is: is there a way to stop the events from firing when moving from the parent to the child( or child's child ). i.e. _testOver will only fire when we drag anything onto the container and _testOut will only fire when we drag it out of container. _testOut should not fire when moving from container to child
Thanks!