@activelylearn/material-ui
Version:
Material-UI's workspace package
27 lines (17 loc) • 1.41 kB
Markdown
---
filename: /packages/material-ui/src/ClickAwayListener/ClickAwayListener.js
---
<!--- This documentation is automatically generated, do not try to edit it. -->
# ClickAwayListener
Listen for click events that are triggered outside of the component children.
## Props
| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name required">children *</span> | <span class="prop-type">node | | |
| <span class="prop-name">mouseEvent</span> | <span class="prop-type">enum: 'onClick' |<br> 'onMouseDown' |<br> 'onMouseUp' |<br> false<br> | <span class="prop-default">'onMouseUp'</span> | |
| <span class="prop-name required">onClickAway *</span> | <span class="prop-type">func | | |
| <span class="prop-name">touchEvent</span> | <span class="prop-type">enum: 'onTouchStart' |<br> 'onTouchEnd' |<br> false<br> | <span class="prop-default">'onTouchEnd'</span> | |
Any other properties supplied will be spread to the root element ([EventListener](https://github.com/oliviertassinari/react-event-listener)).
## Inheritance
The properties of the [EventListener](https://github.com/oliviertassinari/react-event-listener) component, from react-event-listener, are also available.
You can take advantage of this behavior to [target nested components](/guides/api#spread).