Skip to content

Conversation

@dgreif
Copy link
Member

@dgreif dgreif commented Apr 28, 2021

Within a focus zone, we watch for child nodes to be added/removed. Currently, we only do something with those changes if the node that was changed isFocusable, or has been registered as a focus target. If that condition is met, we search all children of the changed node to find focus targets. This setup does not account for scenarios when the added/removed node is not itself focusable, but it does have children that are focusable. This change removes the top-level check and simply always searches for focusable children. This is a noticeable issue in SelectPanel, where the list items are added/removed frequently with changes to the filter.

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

@dgreif dgreif requested review from T-Hugs and colebemis April 28, 2021 01:45
@changeset-bot
Copy link

changeset-bot bot commented Apr 28, 2021

⚠️ No Changeset found

Latest commit: 83484a8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Apr 28, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/primer/primer-components/CRih2tSxg2ui8344DVU9kWcHeJPd
✅ Preview: https://primer-components-git-focus-zone-observer-deep-primer.vercel.app

@dgreif dgreif force-pushed the focus-zone-observer-deep branch from 9924aca to 83484a8 Compare April 28, 2021 01:45
@vercel vercel bot temporarily deployed to Preview April 28, 2021 01:45 Inactive
Copy link
Contributor

@T-Hugs T-Hugs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix! I think I had the isFocusable check in there before adding support for iterating the focusable children and didn't think to remove it.

@dgreif dgreif merged commit a795d6e into main Apr 28, 2021
@dgreif dgreif deleted the focus-zone-observer-deep branch April 28, 2021 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants