diff --git a/src/hooks/useCombobox/index.js b/src/hooks/useCombobox/index.js index 1bc68c74..45a68716 100644 --- a/src/hooks/useCombobox/index.js +++ b/src/hooks/useCombobox/index.js @@ -334,7 +334,7 @@ function useCombobox(userProps = {}) { index, }) } - const itemHandleMouseDown = e => e.preventDefault() + const itemHandleMouseDown = e => e.preventDefault() // keep focus on the input after item click select. return { [refKey]: handleRefs(ref, itemNode => { diff --git a/src/hooks/useSelect/__tests__/getToggleButtonProps.test.js b/src/hooks/useSelect/__tests__/getToggleButtonProps.test.js index db6cd3ed..aa44f73d 100644 --- a/src/hooks/useSelect/__tests__/getToggleButtonProps.test.js +++ b/src/hooks/useSelect/__tests__/getToggleButtonProps.test.js @@ -1709,6 +1709,24 @@ describe('getToggleButtonProps', () => { }) describe('blur', () => { + test('with the menu closed does nothing', async () => { + const initialHighlightedIndex = 2 + renderSelect({initialHighlightedIndex}, ui => { + return ( + <> + {ui} +