Closed TwisterMc closed 2 years ago
There are two ways:
onClickOutside={(e) => { e.preventDefault(); somethingElse()}}
onClickOutside={(e) => { setTimeout(somethingElse)}}
The other possible way is to use some "shadow" element (it can be a pseudo element) 'consuming' clicks. So you will not be able to click on something you should not be able to click.
I've tried the first option and it still clicks through. Wasn't sure if there was something special about this plugin or that I was missing something obvious. Guess I'll look into that shadow element.
Well, I guess I was doing something stupid as it works now. Thanks!
I have FocusOn up and running. When I click outside of the focused area, it's running
onClickOutside
and also clicking on the item in the background. Typically I'd just add something likee.preventDefault();
but that's not working. How do I get it to close FocusOn, but not also click something in the background?