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

Activation lifecycle bugs introduced in #19 #24

Closed benoitgrelard closed 4 years ago

benoitgrelard commented 4 years ago

Hi @theKashey

Since #19 got merged and 3.1.1 got released, the activation lifecycle is not working properly. I haven't managed to specifically find out why, but he's a simple reproduction:

react-focus-on 3.1.0

Working activation lifecycle https://codesandbox.io/s/react-focus-on-310-wg4js

react-focus-on 3.1.1

Activation lifecycle not working correctly https://codesandbox.io/s/react-focus-on-311-3rz2r


Both examples are exactly the same, only the version of react-focus-on differs. Pay attention to the logs:

This is a breaking issue for us and I believe we should rollback that PR (#19) until we can figure out a way to incorporate the intended fix (#17) without breaking the lifecycle.

Let me know what you think!

✌️

theKashey commented 4 years ago

Yeah, hooks are not always great...

theKashey commented 4 years ago

Fixed, try 3.1.3

benoitgrelard commented 4 years ago

Works great, thanks!

theKashey commented 4 years ago

You are welcome.