react-split-pane icon indicating copy to clipboard operation
react-split-pane copied to clipboard

Pass down events to onDragStarted and onDragFinished

Open Ayc0 opened this issue 3 years ago • 0 comments

I noticed an issue on my end where the event wasn't prevented on drag start so I'd need to add event.preventDefault() in this event listener. But the current API doesn't pass down the events in the API so I cannot do this.

The other possibility would be do add event.preventDefault() here

-         onMouseDown={event => onMouseDown(event)}
+         onMouseDown={event => {
+           event.preventDefault();
+           onMouseDown(event);
+         }}

But this could have side effects and as functions like onResizerClick pass down the event, I would prefer to also pass it in the drag eventlisteners

Ayc0 avatar Oct 23 '20 14:10 Ayc0