Skip to content

Commit

Permalink
fix: onMouseDown preventDefault when mode="combobox" (#820)
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 authored Sep 1, 2022
1 parent 1111f68 commit 54a35b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Selector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ const Selector: React.RefForwardingComponent<RefSelectorProps, SelectorProps> =

const onMouseDown: React.MouseEventHandler<HTMLElement> = (event) => {
const inputMouseDown = getInputMouseDown();
if (event.target !== inputRef.current && !inputMouseDown) {

// when mode is combobox, don't prevent default behavior
// https://github.com/ant-design/ant-design/issues/37320
if (event.target !== inputRef.current && !inputMouseDown && mode !== 'combobox') {
event.preventDefault();
}

Expand Down

1 comment on commit 54a35b4

@vercel
Copy link

@vercel vercel bot commented on 54a35b4 Sep 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

select – ./

select-react-component.vercel.app
select.vercel.app
select-git-master-react-component.vercel.app

Please sign in to comment.