gaucho-labs / leptos-hotkeys

a declarative way of using keyboard shortcuts + callbacks in leptos applications
https://leptos-hotkeys.vercel.app
MIT License
43 stars 8 forks source link

Inconsistent results across browsers for use_hotkeys_ref #91

Closed purung closed 5 months ago

purung commented 5 months ago

Hi, thanks for putting time into this awesome library!

I'm having trouble using the hotkeys_ref. The Callback doesn't seem to fire on Firefox 125.0b3 but it works as expected in Edge 123.0.2420.65. Same behavior on the demo site.

I am by no means an expert, but looking at the source code, I noticed that is is adding an event listener for keypress, rather than keydown. Since that event type is deprecated, maybe that has something to do with it? Other than that, I'm not sure what could account for the inconsistent behavior.

friendlymatthew commented 5 months ago

Thanks @purung, I will look into this