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

[core] fix(Popover): 'lazy' support; add tests for 'shouldReturnFocusOnClose' #6579

Merged
merged 4 commits into from
Dec 1, 2023

Conversation

adidahiya
Copy link
Contributor

@adidahiya adidahiya commented Nov 30, 2023

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

  • Fix lazy prop support for Popover (the component was never forwarding that prop to Overlay)
  • Add unit tests for shouldReturnFocusOnClose behavior, illustrating that this requires openOnTargetFocus={false} and shouldReturnFocusOnClose={true} to be set
  • Add shouldReturnFocusOnClose demo to docs example

Reviewers should focus on:

Unit test behavior

Screenshot

2023-11-30 16 49 14

@adidahiya adidahiya marked this pull request as ready for review November 30, 2023 21:50
@adidahiya
Copy link
Contributor Author

update docs example

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya
Copy link
Contributor Author

address self-review

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@@ -290,18 +346,6 @@ describe("<Popover>", () => {
autoFocus: false,
});
});

it("popover remains open after target focus if autoFocus={true}", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this test doesn't really make sense since autoFocus is disabled for "hover" popovers. it should be removed. see code:

const defaultAutoFocus = this.isHoverInteractionKind() ? false : undefined;

@adidahiya
Copy link
Contributor Author

remove invalid test

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya adidahiya merged commit 585c983 into develop Dec 1, 2023
12 checks passed
@adidahiya adidahiya deleted the ad/return-popover-focus-to-target branch December 1, 2023 15:02
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.

1 participant