theKashey / react-focus-lock

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

fix: speedup resolution for auto-guards #281

Closed theKashey closed 5 months ago

theKashey commented 5 months ago

Originally reported by @alexzherdev - tests detected extra time spent at expandFocusableNodes

In fact, this code is only required for auto-guards (<InFocusGuard/>), so let's run it conditionally.

There is a supporting change at the focus-lock size - https://github.com/theKashey/focus-lock/commit/543b9fe9f379e5744f2b51046422b51cf390370c - speeding up nodes resolution