Skip to content

TreeView: Fix initial focus - #2845

Merged
colebemis merged 11 commits into
mainfrom
treeview-initial-focus
Feb 13, 2023
Merged

TreeView: Fix initial focus#2845
colebemis merged 11 commits into
mainfrom
treeview-initial-focus

Conversation

@colebemis

@colebemiscolebemis commented Jan 31, 2023

Copy link
Copy Markdown
Contributor

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

Storybook preview

Closeshttps://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

changeset-botBot commented Jan 31, 2023

Copy link
Copy Markdown

🦋 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
NameType
@primer/reactPatch

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

github-actionsBot commented Jan 31, 2023

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
dist/browser.esm.js89.74 KB (+0.07% 🔺)
dist/browser.umd.js90.28 KB (+0.05% 🔺)

@colebemis
colebemis temporarily deployed to github-pages January 31, 2023 01:48 — with GitHub Actions Inactive
@github-actions
github-actionsBot temporarily deployed to storybook-preview-2845 January 31, 2023 01:48 Inactive
Comment threadsrc/TreeView/useRovingTabIndex.ts
@colebemis
colebemis temporarily deployed to github-pages February 2, 2023 18:48 — with GitHub Actions Inactive
@github-actions
github-actionsBot 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-actionsBot 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 broccolinisoupFebruary 2, 2023 23:48
@colebemis
colebemis temporarily deployed to github-pages February 2, 2023 23:54 — with GitHub Actions Inactive
@github-actions
github-actionsBot temporarily deployed to storybook-preview-2845 February 2, 2023 23:54 Inactive

@broccolinisoupbroccolinisoup left a comment

Copy link
Copy Markdown
Member

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-actionsBot 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-actionsBot temporarily deployed to storybook-preview-2845 February 8, 2023 00:14 Inactive
Comment threadsrc/TabNav/TabNav.tsx
//
// WARNING: We don't recommend using TabNav inside an ActionMenu.
// This is a workaround to avoid breaking existing code.
focusInStrategy: isInsideMenu ? 'previous' : customStrategy,

@colebemiscolebemisFeb 8, 2023

Copy link
Copy Markdown
ContributorAuthor

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-actionsBot 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-actionsBot 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-actionsBot temporarily deployed to storybook-preview-2845 February 9, 2023 19:12 Inactive
@colebemis
colebemis temporarily deployed to github-pages February 13, 2023 18:29 — with GitHub Actions Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-2845 February 13, 2023 18:30 Inactive
@colebemis
colebemis merged commit c31314c into mainFeb 13, 2023
@colebemis
colebemis deleted the treeview-initial-focus branch February 13, 2023 19:59
@primer-cssprimer-css mentioned this pull request Feb 13, 2023
Sign up for freeto 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

@colebemis@broccolinisoup@joshblack