You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's common to want to attach event listeners to the global window. For example, a custom slider element will want to listen to mousedown locally on the slider, but mousemove globally on the window.
Svelte has a svelte:window special element for exactly these use cases.
Implement Suggestion
Taking a cue from svelte, we could add something like a window special element that events can be attached to:
On the desktop platform there is use_wry_event_handler. We use it in SDK here. I don't believe anything similar exists for Web though, aside from using the web-sys crate.
There is some overlap with #628, and #1169. Some way to attach attributes/listeners to somewhere outside of children in Dioxus unlocks a bunch of new usecases
Feature Request
It's common to want to attach event listeners to the global window. For example, a custom slider element will want to listen to mousedown locally on the slider, but mousemove globally on the window.
Svelte has a
svelte:window
special element for exactly these use cases.Implement Suggestion
Taking a cue from svelte, we could add something like a window special element that events can be attached to:
We could also introduce a new
use_window_event
hook or something similar.The text was updated successfully, but these errors were encountered: