DEV Community

Discussion on: Mind the `document.activeElement`!

Collapse
 
ianemv profile image
Ian Villanueva

I think this is it. What I wanted is, to know that my component loses focus so I can toggle or trigger other events.

For now what I did is add a focusable element such as button to check if that is on focus and if focus out, trigger the event I wanted to do (basically just hide a pop-up div)