Skip to content

Commit

Permalink
CustomSelectControlV2: fix popover styles (#62821)
Browse files Browse the repository at this point in the history
* Set max height and overflow behaviour

* add z-index matching legacy popover

* CHANGELOG

* Remove extra prop, revert to 400px

* Switch to flexbox

* Better z-index comment

---

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
  • Loading branch information
3 people authored Jun 26, 2024
1 parent 2be17bb commit 4ef2a62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
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 );
overflow: auto;
overscroll-behavior: contain;
&[data-focus-visible] {
outline: none; // outline will be on the trigger, rather than the popover
}
Expand Down

0 comments on commit 4ef2a62

Please sign in to comment.