click-away-listener

v4.9.10arrow_drop_down
v4.9.10
v4.5.2
v3.9.2
STATUS
Passing
DOWNLOADS
80,974
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
4 years ago
SIZE
3 KB
The wrapped element.
2 contributors
Install click-away-listener as a package?
Copied
npm i @bit/mui-org.material-ui.click-away-listener
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
modifieddraft
chevron_left
chevron_right

The wrapped element.

The mouse event to listen to. You can disable the listener by providing false.

The mouse event to listen to. You can disable the listener by providing false.

Callback fired when a “click away” event is detected.

The touch event to listen to. You can disable the listener by providing false.

Listen for click events that occur somewhere in the document, outside of the element itself. For instance, if you need to hide a menu when people click anywhere else on your page. Demos:

API:

ClickAwayListener ()

Listen for click events that occur somewhere in the document, outside of the element itself. For instance, if you need to hide a menu when people click anywhere else on your page.

Properties
NameTypeDescription
children
custom

The wrapped element.

disableReactTree
bool

The mouse event to listen to. You can disable the listener by providing false.

mouseEvent
'onClick' | 'onMouseDown' | 'onMouseUp' | false

The mouse event to listen to. You can disable the listener by providing false.

onClickAway
(required)
function

Callback fired when a “click away” event is detected.

touchEvent
'onTouchEnd' | 'onTouchStart' | false

The touch event to listen to. You can disable the listener by providing false.

Help and resources