I am performing some actions on onMousedown event. But then they also get executed for drag as drag starts with mouse down.
How can I ensure that actions on mouse-down don't happen for mouse drag?
Note: I am using scalajs-react, though that must not matter.
Mouse drag events trigger an event of
DragEventtype, mouse down triggers onlyMouseEvent. You can differentiate both, by validatingdataTransferattribute, which is only present inDragEvent, like this: