theKashey / react-focus-lock

It is a trap! A lock for a Focus. 🔓
MIT License
1.27k stars 67 forks source link

Feature request - Clickaway deactivation #248

Closed dimitur2204 closed 1 year ago

dimitur2204 commented 1 year ago

I am having a problem trying to make the FocusLock deactivate once the user clicks away from the locked element. Is that possible and if not wouldn't it be nice if there is a prop to enable it?

no-click-deactivation

theKashey commented 1 year ago
dimitur2204 commented 1 year ago
  • Such feature goes agains Single Responsibility Principle and cannot be a part of focus lock
  • But it is a part of https://github.com/theKashey/react-focus-on build on top of this library

    • that is the solution you are looking for

Thanks a lot for the fast answer! It was not a hard thing to implement myself, but I will consider using react-focus-on. Amazing job on all of your repos by the way 🚀