react
react copied to clipboard
fix(treeview): toggle via Space key
Closes #4269
Changelog
New
Allows TreeView directories to toggle their expanded state via Space key press.
Rollout strategy
- [x] Patch release
- [ ] Minor release
- [ ] Major release; if selected, include a written rollout or migration plan
- [ ] None; if selected, include a brief description as to why
Testing & Reviewing
Does not address the other recommended keyboard interactions as they require more significant changes & I'm not sure if they're wanted.
Merge checklist
- [ ] Added/updated tests
- [ ] Added/updated documentation
- [ ] Added/updated previews (Storybook)
- [x] Changes are SSR compatible
- [x] Tested in Chrome
- [x] Tested in Firefox
- [x] Tested in Safari
- [ ] Tested in Edge
- [ ] (GitHub staff only) Integration tests pass at github/github (Learn more about how to run integration tests)
🦋 Changeset detected
Latest commit: af26a92ba586ad9cebeefac62ad3a0c11695e425
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
Hi there @lukeed! 👋 Thanks for taking the time to make the PR.
From what I understand, this behavior isn't currently documented in our API documentation for this component. Let me include @ericwbailey to see if this is behavior that should be added or if it was intentionally not included.
@ericwbailey let me know if you need any more context or if I should include someone else!
Thanks for tagging me, @joshblack.
I'm not opposed to this, but one thing we'll need to think about down the line is how this will intersect with Nested ListView work, where Space will trigger node selection state instead.
I could also use more info on this statement, if you have the time @lukeed:
Does not address the other recommended keyboard interactions as they require more significant changes & I'm not sure if they're wanted.
Hey @ericwbailey, I was referring to this MDN page which I (only, oops) linked in the original issue.
@lukeed Oh sweet, thanks for that. I've got some more thoughts posted over here: https://github.com/github/primer/issues/3057#issuecomment-1954527775
Running integration tests just to make sure this does not break any behavior in gh/gh: https://github.com/github/github/pull/320729
Update: All good!