-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix focus not always returning to expected element on active=false (#139
) This is a new fix for the issue identified in #54 after gaining a better understanding of the issue. The `returnFocusOnDeactivate` flag was being special-cased, but not always, and the element to which focus should be returned, which focus-trap-react attempts to manage on its own (see class Constructor comment for reasoning), was not always correct. For example, if the trap was deactivated, and then re-activated, the 'last focused element before activation' wasn't updated at the moment of re-activation, where it could've changed.
- Loading branch information
1 parent
8d1c06c
commit 01653da
Showing
4 changed files
with
343 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'focus-trap-react': patch | ||
--- | ||
|
||
Fix focus not always returning to correct node after setting `active` prop to `false`. #139 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.