Skip to content

Commit e177d55

Browse files
authored
Remove sx from the SelectPanel component (#6716)
1 parent 45a52c1 commit e177d55

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.changeset/lemon-jokes-camp.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': major
3+
---
4+
5+
Remove sx prop support from the SelectPanel component.

packages/react/src/SelectPanel/SelectPanel.module.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@
9999
}
100100

101101
.FilteredActionList {
102+
/* inheriting height and maxHeight ensures that the FilteredActionList is never taller
103+
than the Overlay (which would break scrolling the items) */
102104
height: inherit;
103105
max-height: inherit;
104106
}
@@ -238,3 +240,7 @@
238240
inset: 0;
239241
background-color: var(--overlay-backdrop-bgColor);
240242
}
243+
244+
.TextInput {
245+
margin: var(--base-size-8);
246+
}

packages/react/src/SelectPanel/SelectPanel.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ function Panel({
178178
footer,
179179
textInputProps,
180180
overlayProps,
181-
sx,
182181
loading,
183182
initialLoadingType = 'spinner',
184183
className,
@@ -656,7 +655,7 @@ function Panel({
656655

657656
const extendedTextInputProps: Partial<TextInputProps> = useMemo(() => {
658657
return {
659-
sx: {m: 2},
658+
className: classes.TextInput,
660659
contrast: true,
661660
leadingVisual: SearchIcon,
662661
'aria-label': inputLabel,
@@ -861,9 +860,6 @@ function Panel({
861860
: EMPTY_MESSAGE.description || EMPTY_MESSAGE.description,
862861
}}
863862
fullScreenOnNarrow={usingFullScreenOnNarrow}
864-
// inheriting height and maxHeight ensures that the FilteredActionList is never taller
865-
// than the Overlay (which would break scrolling the items)
866-
sx={sx}
867863
className={clsx(className, classes.FilteredActionList)}
868864
/>
869865
{footer ? (

0 commit comments

Comments
 (0)