Skip to content

Commit 54a35b4

Browse files
authored
fix: onMouseDown preventDefault when mode="combobox" (#820)
close ant-design/ant-design#37320
1 parent 1111f68 commit 54a35b4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Selector/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@ const Selector: React.RefForwardingComponent<RefSelectorProps, SelectorProps> =
223223

224224
const onMouseDown: React.MouseEventHandler<HTMLElement> = (event) => {
225225
const inputMouseDown = getInputMouseDown();
226-
if (event.target !== inputRef.current && !inputMouseDown) {
226+
227+
// when mode is combobox, don't prevent default behavior
228+
// https://github.com/ant-design/ant-design/issues/37320
229+
if (event.target !== inputRef.current && !inputMouseDown && mode !== 'combobox') {
227230
event.preventDefault();
228231
}
229232

0 commit comments

Comments
 (0)