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

Methods from Deref<Target = NodeRef>

Get the wrapped Node reference if it exists

Try converting the node reference into another form

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Convert self to a value of a Properties struct.

Convert self to a value of a Properties struct.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.