Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.

Allowed components to be focused with "setFocus" even if they have "focusable=false"

Choose a tag to compare

@asgvard asgvard released this 31 Jul 13:22
· 41 commits to master since this release

Latest feature with focusable prop had a check inside setFocus function that blocked component from being imperatively focused. This caused certain regressions, for example when you "setFocus()" on the whole page on mount. The previous logic allowed to save target focus key even if component doesn't exist yet, and then when it gets mounted, the focus was set to this component. So this check was removed to allow setting focus manually on any focusKey (even non existent ones) with setFocus.
Assuming you have full control of where you call setFocus, you can avoid setting it to components that should have focusable={false}, which you also have control of.
focusable prop now only affects "automatic" navigation logic such as directional navigation, focusing lastFocusedChild or preferredFocusChild.