Skip to content

Commit 44572f6

Browse files
committed
fix(Select): trigger onSearch when input is empty
1 parent 4e6cea8 commit 44572f6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/components/select/base/Select.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ const Select = forwardRefWithStatics(
130130
if (disabled) return;
131131
visible && toggleIsScrolling(false);
132132
!visible && onInputChange('', { trigger: 'blur' });
133+
134+
if (visible && isFunction(onSearch) && !inputValue) {
135+
// @ts-ignore
136+
// 实际是由 click 触发而非键盘事件,待补充类型
137+
onSearch('', { e: ctx.e });
138+
}
139+
133140
setShowPopup(visible, ctx);
134141
};
135142

0 commit comments

Comments
 (0)