pub struct UseEuvInput;Expand description
Input functionality for handling form input events.
Provides methods for creating toggle handlers, input value handlers, and focus/blur event handlers.
Implementations§
Source§impl UseEuvInput
Implementation of input functionality.
impl UseEuvInput
Implementation of input functionality.
Sourcepub fn use_toggle(signal: Signal<bool>) -> Option<Rc<dyn Fn(Event)>>
pub fn use_toggle(signal: Signal<bool>) -> Option<Rc<dyn Fn(Event)>>
Creates a click event handler that toggles a boolean signal.
Produces a NativeEventHandler that flips the value of the given
boolean signal on each click. Useful for toggle buttons, visibility
switches, and drawer open/close patterns.
§Arguments
Signal<bool>- The boolean signal to toggle.
§Returns
Option<Rc<dyn Fn(Event)>>- A click event handler that toggles the signal.
Sourcepub fn on_focus_scroll_into_view() -> Option<Rc<dyn Fn(Event)>>
pub fn on_focus_scroll_into_view() -> Option<Rc<dyn Fn(Event)>>
Creates a focus handler that scrolls the focused input into the visible area above the soft keyboard.
The keyboard is accounted for entirely through the visual viewport:
hosts that overlay the IME shrink visualViewport.height (mobile
browsers with interactive-widget=resizes-visual), while immersive
hosts such as euv-app shrink the layout viewport itself through the
native inset bridge (WebView bottomMargin). Both paths place the
visible bottom edge at visualViewport.height + offsetTop, so this
handler never subtracts a keyboard height — doing so double-counts
the IME whenever the host has already resized the view.
When the document is too short to scroll the input far enough, the
remaining deficit is added to <main> as an inline
padding-bottom (cleared on blur by Self::on_blur_restore_height).
Sourcepub fn on_blur_restore_height() -> Option<Rc<dyn Fn(Event)>>
pub fn on_blur_restore_height() -> Option<Rc<dyn Fn(Event)>>
Blur handler that strips the inline padding-bottom injected by
Self::on_focus_scroll_into_view so the page returns to its
native layout once the keyboard closes.
Trait Implementations§
Source§impl Clone for UseEuvInput
impl Clone for UseEuvInput
Source§fn clone(&self) -> UseEuvInput
fn clone(&self) -> UseEuvInput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more