Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't re-assign focus to another Focus Trap #27

Closed
JoaoTMDias opened this issue Jul 14, 2024 · 1 comment · Fixed by #28
Closed

Can't re-assign focus to another Focus Trap #27

JoaoTMDias opened this issue Jul 14, 2024 · 1 comment · Fixed by #28
Assignees
Labels

Comments

@JoaoTMDias
Copy link
Collaborator

Describe the bug
When using the FocusManager component inside, for instance, a Drawer, a Dialog or any other type of UI that needs focus trapping features, the trap works fine.
However, when the user presses enter on, for instance, a button or something that opens another element that also requires focus to be drawn onto it (like a Popover, or another other UI that requires focus trapping as well), then the first FocusManager just won't let go of the focus.

Expected behaviour
Focus should be redirected as needed, when the user needs.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: MacBook Pro M2
  • OS: MacOS Sonoma 14.5
  • Browser Microsoft Edge 126.0.2592.102
  • Version any version from this package
@JoaoTMDias JoaoTMDias self-assigned this Jul 14, 2024
JoaoTMDias pushed a commit that referenced this issue Jul 14, 2024
In order to fix the bug reported on issue 2, this commit does a re-implementation of the FocusManager, by replacing the current
functionality, with the functionality provided by the "focus-trap" package.

In order to keep the same API as before, it makes them still available as before, but changes the default values for autoFocus, restoreFocus and contain props.

It also exposes the "focus-trap" API on the "options".

BREAKING CHANGE: autoFocus, restoreFocus and contain are now set to true by default

Closes #27
JoaoTMDias pushed a commit that referenced this issue Jul 14, 2024
In order to fix the bug reported on issue 2, this commit does a re-implementation of the FocusManager, by replacing the current
functionality, with the functionality provided by the "focus-trap" package.

In order to keep the same API as before, it makes them still available as before, but changes the default values for autoFocus, restoreFocus and contain props.

It also exposes the "focus-trap" API on the "options".

BREAKING CHANGE: autoFocus, restoreFocus and contain are now set to true by default

Closes #27
JoaoTMDias pushed a commit that referenced this issue Jul 15, 2024
In order to fix the bug reported on issue 2, this commit does a re-implementation of the FocusManager, by replacing the current
functionality, with the functionality provided by the "focus-trap" package.

In order to keep the same API as before, it makes them still available as before, but changes the default values for autoFocus, restoreFocus and contain props.

It also exposes the "focus-trap" API on the "options".

BREAKING CHANGE: autoFocus, restoreFocus and contain are now set to true by default

Closes #27
JoaoTMDias pushed a commit that referenced this issue Jul 15, 2024
In order to fix the bug reported on issue 2, this commit does a re-implementation of the FocusManager, by replacing the current
functionality, with the functionality provided by the "focus-trap" package.

In order to keep the same API as before, it makes them still available as before, but changes the default values for autoFocus, restoreFocus and contain props.

It also exposes the "focus-trap" API on the "options".

BREAKING CHANGE: autoFocus, restoreFocus and contain are now set to true by default

Closes #27
github-actions bot pushed a commit that referenced this issue Jul 15, 2024
# [3.0.0](v2.0.1...v3.0.0) (2024-07-15)

### Bug Fixes

* **FocusManager:** Replaces implementation with focus-trap-react ([#28](#28)) ([19bc86c](19bc86c)), closes [#27](#27)

### BREAKING CHANGES

* **FocusManager:** autoFocus, restoreFocus and contain are now set to true by default
* **FocusManager:** the `useFocusManager` was reimplemented. Since we no longer use a React context state management solution to travel between elements, the hook was re-implemented as an optional way to facilitate the creation of a `FocusTrap` instance, but without using the provided element by the package.
Copy link
Contributor

🎉 This issue has been resolved in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant