Lately I've been using tailwindcss and daisyui for my UI css. There's some nice css behaviours those libs have to handle visibility etc that seems to get swallowed by lona. This issue isn't about that (I'll post a minimal example later), as a work-around I'd just like to capture key events. Specifically if a modal is displayed and esc is pressed, toggle close the modal.
My general question is it possible to capture a keypress event and have it sent to the backend?
I've tried handle_input_event_root on a LonaView and handle_input_event on a Widget but that doesn't seem to work unless a TextInput is involved and focused.
I can write a frontend widget to do this (I think) but is there a more lona way to achieve this?
If I were to generalise the issue even more, is there a way to subscribe to frontend DOM events from the backend? This might be out of scope, but I saw in other issues you talking about v2 so I'm hopeful :)
Lately I've been using tailwindcss and daisyui for my UI css. There's some nice css behaviours those libs have to handle visibility etc that seems to get swallowed by lona. This issue isn't about that (I'll post a minimal example later), as a work-around I'd just like to capture key events. Specifically if a modal is displayed and
escis pressed, toggle close the modal.My general question is it possible to capture a keypress event and have it sent to the backend?
I've tried
handle_input_event_rooton aLonaViewandhandle_input_eventon aWidgetbut that doesn't seem to work unless aTextInputis involved and focused.I can write a frontend widget to do this (I think) but is there a more
lonaway to achieve this?If I were to generalise the issue even more, is there a way to subscribe to frontend DOM events from the backend? This might be out of scope, but I saw in other issues you talking about v2 so I'm hopeful :)