|
|
@ -61,11 +61,20 @@ export default function DropdownSearchList ({ |
|
|
|
} |
|
|
|
} |
|
|
|
}, [externallySelectedItem, selectedItem, prevExternallySelectedItem]) |
|
|
|
}, [externallySelectedItem, selectedItem, prevExternallySelectedItem]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onKeyUp = (e) => { |
|
|
|
|
|
|
|
if (e.key === 'Escape') { |
|
|
|
|
|
|
|
close() |
|
|
|
|
|
|
|
} else if (e.key === 'Enter') { |
|
|
|
|
|
|
|
onClickSelector(e) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<button |
|
|
|
<div |
|
|
|
className={classnames('dropdown-search-list', className)} |
|
|
|
className={classnames('dropdown-search-list', className)} |
|
|
|
onClick={onClickSelector} |
|
|
|
onClick={onClickSelector} |
|
|
|
onKeyUp={(e) => e.key === 'Escape' && close()} |
|
|
|
onKeyUp={onKeyUp} |
|
|
|
|
|
|
|
tabIndex="0" |
|
|
|
> |
|
|
|
> |
|
|
|
{!isOpen && ( |
|
|
|
{!isOpen && ( |
|
|
|
<div |
|
|
|
<div |
|
|
@ -129,7 +138,7 @@ export default function DropdownSearchList ({ |
|
|
|
/> |
|
|
|
/> |
|
|
|
</> |
|
|
|
</> |
|
|
|
)} |
|
|
|
)} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|