diff --git a/src/components/MultiSelect/MultiSelect.tsx b/src/components/MultiSelect/MultiSelect.tsx index a6d71a150..bd38e2cca 100644 --- a/src/components/MultiSelect/MultiSelect.tsx +++ b/src/components/MultiSelect/MultiSelect.tsx @@ -3,6 +3,7 @@ import { MouseEvent, ReactNode, forwardRef, + useEffect, useId, useRef, useState, @@ -157,6 +158,7 @@ const Trigger = forwardRef( }, ref ) => { + const [, forceUpate] = useState(0); const { disabled, id, @@ -175,6 +177,10 @@ const Trigger = forwardRef( updateSearch(""); }; + useEffect(() => { + forceUpate(n => n + 1); + }, []); + return ( , "id"> { const Trigger = forwardRef( ({ placeholder = "Select an option", onClick: onClickProp, ...props }, ref) => { + const [, forceUpate] = useState(0); const { disabled, id, hasError, selectedValues, updateSearch, getValueProps } = useCombobox(); const onClick = (e: MouseEvent) => { @@ -182,6 +184,10 @@ const Trigger = forwardRef( }; const nodeProps = selectedValues.length === 0 ? null : getValueProps(selectedValues[0]); + useEffect(() => { + forceUpate(n => n + 1); + }, []); + return (