Skip to content

Conversation

@FezVrasta
Copy link
Contributor

Having access to the browser events is useful if you need to perform logic with the mouse position, modifier keys, etc.

This change should preserve backwards compatibility with the existing interface by adding a second argument to the event callbacks.

@jourdain
Copy link
Collaborator

jourdain commented Aug 9, 2021

Are you sure you are not running into some issue because of the debounce and the fact that react recycle events?

@FezVrasta
Copy link
Contributor Author

FezVrasta commented Aug 9, 2021

React doesn't recycle events anymore starting from React 17, but even in older versions it would be enough to call .persist() if you needed the event to stick around for whatever reason.

I tested this extensively for a day and everything is working as intended, it allowed us to dramatically improve the performance of our custom-made widgets 🥳

@jourdain
Copy link
Collaborator

jourdain commented Aug 9, 2021

Can you add a vtk.js dependency in the example to see if that fix the ci? See #32.

Thanks

@jourdain jourdain merged commit 41febdc into Kitware:master Aug 9, 2021
@FezVrasta FezVrasta deleted the feat/forward-native-event branch August 9, 2021 15:54
@jourdain
Copy link
Collaborator

jourdain commented Aug 9, 2021

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants