pub struct UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>where
DragEl: Into<ElementMaybeSignal<DragT, EventTarget>>,
DragT: Into<EventTarget> + Clone + 'static,
HandleEl: Into<ElementMaybeSignal<HandleT, EventTarget>>,
HandleT: Into<EventTarget> + Clone + 'static,{ /* private fields */ }
Expand description
Options for use_draggable_with_options
.
Implementations§
Source§impl<DragEl, DragT, HandleEl, HandleT> UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>where
DragEl: Into<ElementMaybeSignal<DragT, EventTarget>>,
DragT: Into<EventTarget> + Clone + 'static,
HandleEl: Into<ElementMaybeSignal<HandleT, EventTarget>>,
HandleT: Into<EventTarget> + Clone + 'static,
impl<DragEl, DragT, HandleEl, HandleT> UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>where
DragEl: Into<ElementMaybeSignal<DragT, EventTarget>>,
DragT: Into<EventTarget> + Clone + 'static,
HandleEl: Into<ElementMaybeSignal<HandleT, EventTarget>>,
HandleT: Into<EventTarget> + Clone + 'static,
Sourcepub fn exact(self, value: impl Into<MaybeSignal<bool>>) -> Self
pub fn exact(self, value: impl Into<MaybeSignal<bool>>) -> Self
Only start the dragging when click on the element directly. Defaults to false
.
Sourcepub fn prevent_default(self, value: impl Into<MaybeSignal<bool>>) -> Self
pub fn prevent_default(self, value: impl Into<MaybeSignal<bool>>) -> Self
Prevent events defaults. Defaults to false
.
Sourcepub fn stop_propagation(self, value: impl Into<MaybeSignal<bool>>) -> Self
pub fn stop_propagation(self, value: impl Into<MaybeSignal<bool>>) -> Self
Prevent events propagation. Defaults to false
.
Sourcepub fn dragging_element<New__DragEl, New__DragT>(
self,
value: New__DragEl,
) -> UseDraggableOptions<New__DragEl, New__DragT, HandleEl, HandleT>where
New__DragEl: Into<ElementMaybeSignal<New__DragT, EventTarget>>,
New__DragT: Into<EventTarget> + Clone + 'static,
HandleEl: Into<ElementMaybeSignal<HandleT, EventTarget>>,
HandleT: Into<EventTarget> + Clone + 'static,
pub fn dragging_element<New__DragEl, New__DragT>(
self,
value: New__DragEl,
) -> UseDraggableOptions<New__DragEl, New__DragT, HandleEl, HandleT>where
New__DragEl: Into<ElementMaybeSignal<New__DragT, EventTarget>>,
New__DragT: Into<EventTarget> + Clone + 'static,
HandleEl: Into<ElementMaybeSignal<HandleT, EventTarget>>,
HandleT: Into<EventTarget> + Clone + 'static,
Element to attach pointermove
and pointerup
events to. Defaults to window
.
Sourcepub fn handle<New__HandleEl, New__HandleT>(
self,
value: Option<New__HandleEl>,
) -> UseDraggableOptions<DragEl, DragT, New__HandleEl, New__HandleT>where
DragEl: Into<ElementMaybeSignal<DragT, EventTarget>>,
DragT: Into<EventTarget> + Clone + 'static,
New__HandleEl: Into<ElementMaybeSignal<New__HandleT, EventTarget>>,
New__HandleT: Into<EventTarget> + Clone + 'static,
pub fn handle<New__HandleEl, New__HandleT>(
self,
value: Option<New__HandleEl>,
) -> UseDraggableOptions<DragEl, DragT, New__HandleEl, New__HandleT>where
DragEl: Into<ElementMaybeSignal<DragT, EventTarget>>,
DragT: Into<EventTarget> + Clone + 'static,
New__HandleEl: Into<ElementMaybeSignal<New__HandleT, EventTarget>>,
New__HandleT: Into<EventTarget> + Clone + 'static,
Handle that triggers the drag event. Defaults to target
.
Sourcepub fn pointer_types(self, value: Vec<PointerType>) -> Self
pub fn pointer_types(self, value: Vec<PointerType>) -> Self
Pointer types that listen to. Defaults to [Mouse, Touch, Pen]
.
Sourcepub fn initial_value(self, value: impl Into<MaybeRwSignal<Position>>) -> Self
pub fn initial_value(self, value: impl Into<MaybeRwSignal<Position>>) -> Self
Initial position of the element. Defaults to { x: 0, y: 0 }
.
Sourcepub fn on_start(
self,
value: impl Fn(UseDraggableCallbackArgs) -> bool + 'static,
) -> Self
pub fn on_start( self, value: impl Fn(UseDraggableCallbackArgs) -> bool + 'static, ) -> Self
Callback when the dragging starts. Return false
to prevent dragging.
Sourcepub fn on_move(self, value: impl Fn(UseDraggableCallbackArgs) + 'static) -> Self
pub fn on_move(self, value: impl Fn(UseDraggableCallbackArgs) + 'static) -> Self
Callback during dragging.
Sourcepub fn on_end(self, value: impl Fn(UseDraggableCallbackArgs) + 'static) -> Self
pub fn on_end(self, value: impl Fn(UseDraggableCallbackArgs) + 'static) -> Self
Callback when dragging end.
Trait Implementations§
Source§impl Default for UseDraggableOptions<UseWindow, Window, EventTarget, EventTarget>
impl Default for UseDraggableOptions<UseWindow, Window, EventTarget, EventTarget>
Auto Trait Implementations§
impl<DragEl, DragT, HandleEl, HandleT> Freeze for UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>
impl<DragEl, DragT, HandleEl, HandleT> !RefUnwindSafe for UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>
impl<DragEl, DragT, HandleEl, HandleT> !Send for UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>
impl<DragEl, DragT, HandleEl, HandleT> !Sync for UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>
impl<DragEl, DragT, HandleEl, HandleT> Unpin for UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>
impl<DragEl, DragT, HandleEl, HandleT> !UnwindSafe for UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>
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