Skip to content

Commit 3477d9c

Browse files
(Picklist): restore the buttonRef prop
1 parent bf49d8d commit 3477d9c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/scripts/Picklist.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export type PicklistProps<MultiSelect extends boolean | undefined> = {
173173
tooltip?: ReactNode;
174174
tooltipIcon?: string;
175175
elementRef?: Ref<HTMLDivElement>;
176+
buttonRef?: Ref<HTMLDivElement>;
176177
dropdownRef?: Ref<HTMLDivElement>;
177178
onValueChange?: Bivariant<
178179
(
@@ -214,6 +215,7 @@ export const Picklist: (<MultiSelect extends boolean | undefined>(
214215
tooltip,
215216
tooltipIcon,
216217
elementRef: elementRef_,
218+
buttonRef: buttonRef_,
217219
dropdownRef: dropdownRef_,
218220
onSelect,
219221
onComplete,
@@ -336,6 +338,7 @@ export const Picklist: (<MultiSelect extends boolean | undefined>(
336338
const elRef = useRef<HTMLDivElement | null>(null);
337339
const elementRef = useMergeRefs([elRef, elementRef_]);
338340
const comboboxElRef = useRef<HTMLDivElement | null>(null);
341+
const buttonRef = useMergeRefs([comboboxElRef, buttonRef_]);
339342
const dropdownElRef = useRef<HTMLDivElement | null>(null);
340343
const dropdownRef = useMergeRefs([dropdownElRef, dropdownRef_]);
341344

@@ -559,7 +562,7 @@ export const Picklist: (<MultiSelect extends boolean | undefined>(
559562
role='none'
560563
>
561564
<div
562-
ref={comboboxElRef}
565+
ref={buttonRef}
563566
role='combobox'
564567
tabIndex={disabled ? -1 : 0}
565568
className={inputClassNames}

0 commit comments

Comments
 (0)