File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @primer/components ' : patch
3+ ---
4+
5+ Expose 'textInputProps' from the 'SelectPanel'
Original file line number Diff line number Diff line change @@ -46,12 +46,6 @@ const focusZoneSettings: Partial<FocusZoneHookSettings> = {
4646 disabled : true
4747}
4848
49- const textInputProps : Partial < TextInputProps > = {
50- mx : 2 ,
51- my : 2 ,
52- contrast : true
53- }
54-
5549export function SelectPanel ( {
5650 open,
5751 onOpenChange,
@@ -62,6 +56,7 @@ export function SelectPanel({
6256 filterValue : externalFilterValue ,
6357 onFilterChange : externalOnFilterChange ,
6458 items,
59+ textInputProps,
6560 overlayProps,
6661 ...listProps
6762} : SelectPanelProps ) : JSX . Element {
@@ -132,6 +127,15 @@ export function SelectPanel({
132127 initialFocusRef : inputRef
133128 }
134129
130+ const extendedTextInputProps : Partial < TextInputProps > = useMemo ( ( ) => {
131+ return {
132+ mx : 2 ,
133+ my : 2 ,
134+ contrast : true ,
135+ ...textInputProps
136+ }
137+ } , [ textInputProps ] )
138+
135139 return (
136140 < AnchoredOverlay
137141 renderAnchor = { renderMenuAnchor }
@@ -150,7 +154,7 @@ export function SelectPanel({
150154 role = "listbox"
151155 items = { itemsToRender }
152156 selectionVariant = { isMultiSelectVariant ( selected ) ? 'multiple' : 'single' }
153- textInputProps = { textInputProps }
157+ textInputProps = { extendedTextInputProps }
154158 inputRef = { inputRef }
155159 />
156160 </ Flex >
You can’t perform that action at this time.
0 commit comments