@svelte-put/clickoutside
v4.0.0
Published
Event for clicking outside a node
Downloads
11,072
Maintainers
Readme
@svelte-put/clickoutside
Svelte action use:clickoutside
- event for clicking outside a node
svelte-put
This package is part of the @svelte-put family. For contributing guideline and more, refer to its readme.
Usage & Documentation
See the dedicated documentation page here.
Quick Start
<script lang="ts">
import { clickoutside } from '@svelte-put/clickoutside';
function doSomething(e: CustomEvent<MouseEvent>) {
console.log(e.target);
}
</script>
<div use:clickoutside onclickoutside="{doSomething}" />