1.0.0 • Published 3 years ago

@meveo-org/mv-click-away v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

mv-click-away

MvClickAway is a Meveo component (based on lit-element) that registers a click event on the document allowing child components to listen to a custom event when a click outside the component is triggered.

Quick Start

To experiment with the MvClickAway component.

  1. Clone this repo.

  2. Serve the project from the root directory with some http server (best served with meveo itself)

  3. Update the click-away demo component in demo.js file

Sample usage

<mv-click-away @clicked-away="${() => {console.log("something else was clicked")}}">
  <child-component></child-component>
</mv-click-away>

You can also check this demo