pub struct GlobalClose { /* private fields */ }Expand description
Helper to trigger a close operation, when the user clicks on the global space.
This can be e.g. used for a drop down menu, where the component should be closed when the user clicks outside of the dropped down content.
In order to use this, you need to define and assign the NodeRef to an element which is
considered the “inside”. When the user clicks “outside” of the referenced element, it will
execute the callback.
When the instance is dropped, the callback will no longer be fired.
When creating the structure, you can pass in a new NodeRef, and you can deref and clone
later using the function GlobalClose::node_ref.
Implementations§
Trait Implementations§
Source§impl Deref for GlobalClose
impl Deref for GlobalClose
Auto Trait Implementations§
impl Freeze for GlobalClose
impl !RefUnwindSafe for GlobalClose
impl !Send for GlobalClose
impl !Sync for GlobalClose
impl Unpin for GlobalClose
impl !UnwindSafe for GlobalClose
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.