Skip to content

Commit 0796710

Browse files
author
刘欢
committed
feat: set default value ""
1 parent 3acb0fb commit 0796710

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Select.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ const Select = React.forwardRef<BaseSelectRef, SelectProps<any, DefaultOptionTyp
272272
);
273273

274274
// =========================== Search ===========================
275-
const [mergedSearchValue, setSearchValue] = useControlledState('', searchValue);
275+
const [internalSearchValue, setSearchValue] = useControlledState('', searchValue);
276+
const mergedSearchValue = internalSearchValue || '';
276277

277278
// =========================== Option ===========================
278279
const parsedOptions = useOptions(

0 commit comments

Comments
 (0)