clickOutside
import { clickOutside } from 'svogg-components';
Utility for handling clicking outside an element. Useful for e.g. modals and drawers.
Try it out by opening up the console and clicking outside the card in the demo.
Demo
Code
Click outside me!
Params
Name | Type | Required | Description |
---|---|---|---|
handler | Function | true | Callback that runs when clicking outside the element. |