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 event handler that scrolls the focused input into view.
On mobile devices, focusing an input can open the virtual keyboard and obscure
the field. This handler waits briefly for the keyboard to appear, then checks
whether the input’s bottom edge is below the visible viewport (using
VisualViewport when available). If so, it scrolls the page just enough to
leave a small gap between the input and the keyboard.
§Returns
Option<Rc<dyn Fn(Event)>>- A focus handler.
Sourcepub fn on_blur_restore_height() -> Option<Rc<dyn Fn(Event)>>
pub fn on_blur_restore_height() -> Option<Rc<dyn Fn(Event)>>
Creates a blur event handler that restores the page height after input focus.
Removes the temporary padding-bottom injected by on_focus_scroll_into_view
so that the page returns to its original height once the virtual keyboard
is dismissed.
§Returns
Option<Rc<dyn Fn(Event)>>- A blur handler.
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 moreimpl Copy for UseEuvInput
Source§impl Debug for UseEuvInput
impl Debug for UseEuvInput
Source§impl Default for UseEuvInput
impl Default for UseEuvInput
Source§fn default() -> UseEuvInput
fn default() -> UseEuvInput
impl Eq for UseEuvInput
Source§impl Hash for UseEuvInput
impl Hash for UseEuvInput
Source§impl Ord for UseEuvInput
impl Ord for UseEuvInput
Source§fn cmp(&self, other: &UseEuvInput) -> Ordering
fn cmp(&self, other: &UseEuvInput) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for UseEuvInput
impl PartialEq for UseEuvInput
Source§fn eq(&self, other: &UseEuvInput) -> bool
fn eq(&self, other: &UseEuvInput) -> bool
self and other values to be equal, and is used by ==.