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

feat(Popover): allow focus upon popover panel open #1782

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

booc0mtaco
Copy link
Contributor

@booc0mtaco booc0mtaco commented Oct 12, 2023

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:

  • Wrote automated tests
  • CI tests / new tests are not applicable
  • Manually tested my changes, but I want to keep the details secret
  • Manually tested my changes, and here are the details:
    • Create an alpha publish and try out in edu-stack or traject 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.

@booc0mtaco booc0mtaco requested a review from a team October 12, 2023 00:38
@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #1782 (3576c58) into next (971f189) will not change coverage.
The diff coverage is n/a.

@@           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           
Files Coverage Δ
src/components/Popover/Popover.tsx 91.89% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link

github-actions bot commented Oct 12, 2023

size-limit report 📦

Path Size
components 97.05 KB (0%)
styles 32.96 KB (0%)

src/components/Popover/Popover.stories.tsx Outdated Show resolved Hide resolved
<Popover.Button as={Button} data-testid="popover-trigger-button">
Open Popover
</Popover.Button>
<Popover.Content data-testid="popover-content" focus>
Copy link
Contributor

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?

Copy link
Contributor Author

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
@booc0mtaco booc0mtaco merged commit 76ddbc6 into next Oct 12, 2023
8 checks passed
@booc0mtaco booc0mtaco deleted the aholloway/EFI-1418 branch October 12, 2023 18:11
@booc0mtaco booc0mtaco mentioned this pull request Oct 13, 2023
booc0mtaco added a commit that referenced this pull request Oct 13, 2023
## [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))
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.

2 participants