-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
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:
rsx! {
dioxus:window {
onmousemove: move |event| handle_mousemove(event)
}
div {
id: "slider",
onmousedown: move |event| handle_mousedown(event),
...
}
}We could also introduce a new use_window_event hook or something similar.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request