behaviors
behaviors copied to clipboard
Prevent focusing hidden/disabled elements
Closes https://github.com/primer/behaviors/issues/257
This PR attempts to address the issue where if an element is disabled or hidden after the focusZone function has ran, the focus trap no longer works. I've adjusted the mutation observer that watches for added or removed nodes within the focusZone container to now track the hidden and disabled attributes.
If either attribute is applied or removed, they will added/removed from the focus trap respectively.
🦋 Changeset detected
Latest commit: a54cafcfa9c3ab26578f6b4347c4028b7066cfd5
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @primer/behaviors | Minor |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days.
Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days.
Hey team! I was wondering if I could get a review on this PR? For context it's making sure that disabled or hidden elements are removed from the focus zone if they are disabled/hidden after it has been initiated. It'll also add the elements back if they are no longer disabled/hidden. This is primarily useful when using focus-zone outside of React.
@primer/engineer-reviewers