-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(Popover): allow focus upon popover panel open #1782
Conversation
Codecov Report
@@ Coverage Diff @@
## next #1782 +/- ##
=======================================
Coverage 92.35% 92.35%
=======================================
Files 147 147
Lines 2656 2656
Branches 711 711
=======================================
Hits 2453 2453
Misses 187 187
Partials 16 16
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
size-limit report 📦
|
<Popover.Button as={Button} data-testid="popover-trigger-button"> | ||
Open Popover | ||
</Popover.Button> | ||
<Popover.Content data-testid="popover-content" focus> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be missing something, why does the content need focus
set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
focus
enables the behavior where it will focus on the element once the popover is generated
- expose the `focus` option from HeadlessUI's .Panel API - add test with `play` to trigger the behavio for a snapshot
7d59ebe
to
3576c58
Compare
## [13.6.0](v13.5.0...v13.6.0) (2023-10-13) ### Features * **Menu:** allow href and onClick to co-exist on a menu item ([#1779](#1779)) ([971f189](971f189)) * **Popover:** allow focus upon popover panel open ([#1782](#1782)) ([76ddbc6](76ddbc6)) ### Bug Fixes * **Accordion:** handle multi-line text in headers ([#1783](#1783)) ([0b3c3e6](0b3c3e6)) * **Select:** expose render prop and default value param.s ([#1781](#1781)) ([f21e2b6](f21e2b6))
Summary:
Merge in the props from HeadlessUI for the panel, to support
focus
. This allows consumers to send focus to a particular piece of content within the content container.onFocus
also allows for hooking into the internals in case there are some arguments to trigger upon focus.Test Plan:
edu-stack
ortraject
as a sanity check if changes affect build or deploy, or are breaking, such as token changes, widely used component updates, hooks changes, and major dependency upgrades.