Skip to content

Commit b70d9c8

Browse files
zombieJclaude
andcommitted
docs: add comment explaining rawOpen usage
Clarify why rawOpen is used instead of mergedOpen to prevent premature clearing of search input. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 27b1955 commit b70d9c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/BaseSelect/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,10 @@ const BaseSelect = React.forwardRef<BaseSelectRef, BaseSelectProps>((props, ref)
430430
onSearch(searchText, { source: 'submit' });
431431
};
432432

433-
// Close will clean up single mode search text
433+
// Clean up search value when the dropdown is closed.
434+
// We use `rawOpen` here to avoid clearing the search input when the dropdown is
435+
// programmatically closed due to `notFoundContent={null}` and no matching options.
436+
// This allows the user to continue typing their search query.
434437
React.useEffect(() => {
435438
if (!rawOpen && !multiple && mode !== 'combobox') {
436439
onInternalSearch('', false, false);

0 commit comments

Comments
 (0)