Skip to content

Commit 4ef2a62

Browse files
ciampomirka
andauthored
CustomSelectControlV2: fix popover styles (#62821)
* 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 <[email protected]> Co-authored-by: mirka <[email protected]>
1 parent 2be17bb commit 4ef2a62

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

packages/components/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Internal
66

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

910
## 28.2.0 (2024-06-26)
1011

packages/components/src/custom-select-control-v2/styles.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,20 @@ export const Select = styled( Ariakit.Select, {
105105
} );
106106

107107
export const SelectPopover = styled( Ariakit.SelectPopover )`
108+
display: flex;
109+
flex-direction: column;
110+
111+
background-color: ${ COLORS.theme.background };
108112
border-radius: 2px;
109-
background: ${ COLORS.theme.background };
110113
border: 1px solid ${ COLORS.theme.foreground };
111114
115+
/* z-index(".components-popover") */
116+
z-index: 1000000;
117+
118+
max-height: min( var( --popover-available-height, 400px ), 400px );
119+
overflow: auto;
120+
overscroll-behavior: contain;
121+
112122
&[data-focus-visible] {
113123
outline: none; // outline will be on the trigger, rather than the popover
114124
}

0 commit comments

Comments
 (0)