theKashey / react-focus-on

🎯 Solution for WAI ARIA compatible modal dialogs or full-screen tasks, you were looking for
MIT License
336 stars 14 forks source link

`onClickOutside` and `onEscapeKey` doesn't update callbacks #17

Closed makarov906 closed 4 years ago

makarov906 commented 4 years ago

Hello @theKashey,

I have realised that onClickOutside and onEscapeKey doesn't update callbacks. I did some research, and I think it because useEffect in Effect.tsx doesn't get deps for update those funcs (here)

Or maybe there is another way to do this?

theKashey commented 4 years ago

The easiest way - just fix the root cause.

theKashey commented 4 years ago

I've drafter PR with the possible fix for this issue, but it would take some time to actually test it.

theKashey commented 4 years ago

Released as 3.1.1 beta, as long as I haven't found time to test it in isolation, so gonna test in some external projects first, before removing a beta flag. Join the club.