Struct leptos_use::UseEventListenerOptions
source · pub struct UseEventListenerOptions { /* private fields */ }Expand description
Options for use_event_listener_with_options.
Implementations§
source§impl UseEventListenerOptions
impl UseEventListenerOptions
sourcepub fn capture(self, value: bool) -> Self
pub fn capture(self, value: bool) -> Self
A boolean value indicating that events of this type will be dispatched to
the registered listener before being dispatched to any EventTarget
beneath it in the DOM tree. If not specified, defaults to false.
sourcepub fn once(self, value: bool) -> Self
pub fn once(self, value: bool) -> Self
A boolean value indicating that the listener should be invoked at most
once after being added. If true, the listener would be automatically
removed when invoked. If not specified, defaults to false.
sourcepub fn passive<OptionInnerType>(
self,
value: impl Into<Option<OptionInnerType>>,
) -> Self
pub fn passive<OptionInnerType>( self, value: impl Into<Option<OptionInnerType>>, ) -> Self
A boolean value that, if true, indicates that the function specified by
listener will never call
preventDefault().
If a passive listener does call preventDefault(), the user agent will do
nothing other than generate a console warning. If not specified,
defaults to false – except that in browsers other than Safari,
defaults to true for the
wheel,
mousewheel,
touchstart and
touchmove
events. See Improving scrolling performance with passive listeners
to learn more.
Trait Implementations§
source§impl Clone for UseEventListenerOptions
impl Clone for UseEventListenerOptions
source§fn clone(&self) -> UseEventListenerOptions
fn clone(&self) -> UseEventListenerOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Default for UseEventListenerOptions
impl Default for UseEventListenerOptions
source§fn default() -> UseEventListenerOptions
fn default() -> UseEventListenerOptions
impl Copy for UseEventListenerOptions
Auto Trait Implementations§
impl Freeze for UseEventListenerOptions
impl RefUnwindSafe for UseEventListenerOptions
impl Send for UseEventListenerOptions
impl Sync for UseEventListenerOptions
impl Unpin for UseEventListenerOptions
impl UnwindSafe for UseEventListenerOptions
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more