Struct patternfly_yew::GlobalClose [−][src]
pub struct GlobalClose { /* fields omitted */ }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.