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

CustomSelectControlV2: fix popover styles #62821

Merged
merged 6 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Internal

- `CustomSelectControlV2`: add root element wrapper. ([#62803](https://github.com/WordPress/gutenberg/pull/62803))
- `CustomSelectControlV2`: fix popover styles. ([#62821](https://github.com/WordPress/gutenberg/pull/62821))

## 28.2.0 (2024-06-26)

Expand Down
12 changes: 11 additions & 1 deletion packages/components/src/custom-select-control-v2/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,20 @@ export const Select = styled( Ariakit.Select, {
} );

export const SelectPopover = styled( Ariakit.SelectPopover )`
display: flex;
flex-direction: column;

background-color: ${ COLORS.theme.background };
border-radius: 2px;
background: ${ COLORS.theme.background };
border: 1px solid ${ COLORS.theme.foreground };

/* z-index(".components-popover") */
z-index: 1000000;

max-height: min( var( --popover-available-height, 400px ), 400px );
Copy link
Member

Choose a reason for hiding this comment

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

This is fine for legacy (and for the purposes of this PR), but I think we will also need a way for consumers to override this (#49110).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point — not necessarily part of the tweaks to V2 legacy, but important to keep in mind for future work. It's also tracked in #55023

overflow: auto;
overscroll-behavior: contain;

&[data-focus-visible] {
outline: none; // outline will be on the trigger, rather than the popover
}
Expand Down
Loading