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

TreeView: Fix initial focus #2845

Merged
merged 11 commits into from
Feb 13, 2023
Merged

TreeView: Fix initial focus #2845

merged 11 commits into from
Feb 13, 2023

Conversation

colebemis
Copy link
Contributor

@colebemis colebemis commented Jan 31, 2023

Defines a custom focusInStrategy for the focusZone behavior so the "current" treeitem is focused by default when a user focuses a TreeView.

Storybook preview

Closes https://github.com/github/primer/issues/1750

Before

CleanShot.2023-01-31.at.13.54.32.mp4

After

CleanShot.2023-01-31.at.13.52.14.mp4

@changeset-bot
Copy link

changeset-bot bot commented Jan 31, 2023

🦋 Changeset detected

Latest commit: 645d0f5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 31, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 89.74 KB (+0.07% 🔺)
dist/browser.umd.js 90.28 KB (+0.05% 🔺)

@colebemis colebemis temporarily deployed to github-pages January 31, 2023 01:48 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2845 January 31, 2023 01:48 Inactive
@colebemis colebemis temporarily deployed to github-pages February 2, 2023 18:48 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2845 February 2, 2023 18:48 Inactive
@colebemis colebemis temporarily deployed to github-pages February 2, 2023 20:29 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2845 February 2, 2023 20:29 Inactive
@colebemis colebemis marked this pull request as ready for review February 2, 2023 23:48
@colebemis colebemis requested review from a team and broccolinisoup February 2, 2023 23:48
@colebemis colebemis temporarily deployed to github-pages February 2, 2023 23:54 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2845 February 2, 2023 23:54 Inactive
Copy link
Member

@broccolinisoup broccolinisoup left a comment

Choose a reason for hiding this comment

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

🚀

@colebemis colebemis temporarily deployed to github-pages February 7, 2023 23:05 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2845 February 7, 2023 23:06 Inactive
@colebemis colebemis temporarily deployed to github-pages February 8, 2023 00:14 — with GitHub Actions Inactive
@colebemis colebemis marked this pull request as draft February 8, 2023 00:14
@github-actions github-actions bot temporarily deployed to storybook-preview-2845 February 8, 2023 00:14 Inactive
//
// WARNING: We don't recommend using TabNav inside an ActionMenu.
// This is a workaround to avoid breaking existing code.
focusInStrategy: isInsideMenu ? 'previous' : customStrategy,
Copy link
Contributor Author

@colebemis colebemis Feb 8, 2023

Choose a reason for hiding this comment

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

Updating focusInStrategy to be compatiable with TreeView caused some TabNav tests to fail so I needed to the TabNav focusZone behavior. cc @joshblack since you were the last person to touch this code in #2468

This also fixes #2855

@colebemis colebemis temporarily deployed to github-pages February 8, 2023 23:45 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2845 February 8, 2023 23:45 Inactive
@colebemis colebemis temporarily deployed to github-pages February 8, 2023 23:56 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2845 February 8, 2023 23:56 Inactive
@colebemis colebemis marked this pull request as ready for review February 9, 2023 01:36
@colebemis colebemis temporarily deployed to github-pages February 9, 2023 19:12 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2845 February 9, 2023 19:12 Inactive
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.

None yet

3 participants