sakhnyuk / rc-scrollbars

React scrollbars component
https://rc-scrollbars.vercel.app/
MIT License
145 stars 14 forks source link

Add custom event handlers for components? #27

Open JohnHKoh opened 3 years ago

JohnHKoh commented 3 years ago

Is there a way to add our own customer event handlers for certain components? For instance, I am trying to add a onMouseDown event handler for thumbVertical. I have tried adding the onMouseDown JSX attribute to renderThumbVertical, but it seems like my custom event handler is being overridden by Scrollbars.prototype.handleVerticalThumbMouseDown. Removing this event listener using the Chrome DevTools allows my custom event handler to be called.

I am currently working around this by using the onPointerDown JSX attribute instead, but this is more of a hack and not a solution.

Is there a built-in way to override this behavior, and if not, are there plans to add such a capability in the future? Thanks.