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.
To experiment with the MvClickAway component.
-
Clone this repo.
-
Serve the project from the root directory with some http server (best served with meveo itself)
-
Update the click-away demo component in demo.js file
<mv-click-away @clicked-away="${() => {console.log("something else was clicked")}}">
<child-component></child-component>
</mv-click-away>
You can also check this demo