clickOutsideAction

On click outside action.

Demo

Click outside me!

Click outside me!

Usage

<script>
import { clickOutsideAction } from "svelte-legos";

let hidden = false;

function handleClickOutside() {
  hidden = !hidden;
}
</script>

<div
  class="modal"
  use:clickOutsideAction
  on:clickoutside={handleClickOutside}
/>

<div
  class="modal"
  use:clickOutsideAction={handleClickOutside}
/>