Struct leptos_use::UseMouseInElementOptions
source · pub struct UseMouseInElementOptions<El, T, Ex>where
El: Clone + Into<ElementMaybeSignal<T, EventTarget>>,
T: Into<EventTarget> + Clone + 'static,
Ex: UseMouseEventExtractor + Clone,{ /* private fields */ }
Expand description
Options for use_mouse_in_element_with_options
.
Implementations§
source§impl<El, T, Ex> UseMouseInElementOptions<El, T, Ex>where
El: Clone + Into<ElementMaybeSignal<T, EventTarget>>,
T: Into<EventTarget> + Clone + 'static,
Ex: UseMouseEventExtractor + Clone,
impl<El, T, Ex> UseMouseInElementOptions<El, T, Ex>where
El: Clone + Into<ElementMaybeSignal<T, EventTarget>>,
T: Into<EventTarget> + Clone + 'static,
Ex: UseMouseEventExtractor + Clone,
sourcepub fn coord_type<New__Ex>(
self,
value: UseMouseCoordType<New__Ex>
) -> UseMouseInElementOptions<El, T, New__Ex>where
El: Clone + Into<ElementMaybeSignal<T, EventTarget>>,
T: Into<EventTarget> + Clone + 'static,
New__Ex: UseMouseEventExtractor + Clone,
pub fn coord_type<New__Ex>(
self,
value: UseMouseCoordType<New__Ex>
) -> UseMouseInElementOptions<El, T, New__Ex>where
El: Clone + Into<ElementMaybeSignal<T, EventTarget>>,
T: Into<EventTarget> + Clone + 'static,
New__Ex: UseMouseEventExtractor + Clone,
How to extract the x, y coordinates from mouse events or touches
sourcepub fn target<New__El, New__T>(
self,
value: New__El
) -> UseMouseInElementOptions<New__El, New__T, Ex>where
New__El: Clone + Into<ElementMaybeSignal<New__T, EventTarget>>,
New__T: Into<EventTarget> + Clone + 'static,
Ex: UseMouseEventExtractor + Clone,
pub fn target<New__El, New__T>(
self,
value: New__El
) -> UseMouseInElementOptions<New__El, New__T, Ex>where
New__El: Clone + Into<ElementMaybeSignal<New__T, EventTarget>>,
New__T: Into<EventTarget> + Clone + 'static,
Ex: UseMouseEventExtractor + Clone,
Listen events on target
element. Defaults to window
sourcepub fn reset_on_touch_ends(self, value: bool) -> Self
pub fn reset_on_touch_ends(self, value: bool) -> Self
Reset to initial value when touchend
event fired. Defaults to false
sourcepub fn initial_value(self, value: Position) -> Self
pub fn initial_value(self, value: Position) -> Self
Initial values. Defaults to {x: 0.0, y: 0.0}
.
sourcepub fn handle_outside(self, value: bool) -> Self
pub fn handle_outside(self, value: bool) -> Self
If true
updates the element_x
and element_y
signals even if the
mouse is outside of the element. If false
it doesn’t update them when outside.
Defaults to true
.
Trait Implementations§
Auto Trait Implementations§
impl<El, T, Ex> Freeze for UseMouseInElementOptions<El, T, Ex>
impl<El, T, Ex> RefUnwindSafe for UseMouseInElementOptions<El, T, Ex>
impl<El, T, Ex> Send for UseMouseInElementOptions<El, T, Ex>
impl<El, T, Ex> Sync for UseMouseInElementOptions<El, T, Ex>
impl<El, T, Ex> Unpin for UseMouseInElementOptions<El, T, Ex>
impl<El, T, Ex> UnwindSafe for UseMouseInElementOptions<El, T, Ex>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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