mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Switch to DIV for swaps dropdown accessibility (#9732)
This commit is contained in:
parent
3bbc1d1fa4
commit
61e48b4a84
@ -61,11 +61,20 @@ export default function DropdownSearchList ({
|
||||
}
|
||||
}, [externallySelectedItem, selectedItem, prevExternallySelectedItem])
|
||||
|
||||
const onKeyUp = (e) => {
|
||||
if (e.key === 'Escape') {
|
||||
close()
|
||||
} else if (e.key === 'Enter') {
|
||||
onClickSelector(e)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
<div
|
||||
className={classnames('dropdown-search-list', className)}
|
||||
onClick={onClickSelector}
|
||||
onKeyUp={(e) => e.key === 'Escape' && close()}
|
||||
onKeyUp={onKeyUp}
|
||||
tabIndex="0"
|
||||
>
|
||||
{!isOpen && (
|
||||
<div
|
||||
@ -129,7 +138,7 @@ export default function DropdownSearchList ({
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,4 @@
|
||||
.dropdown-search-list {
|
||||
flex-flow: column;
|
||||
border: none;
|
||||
background: unset;
|
||||
padding: 0;
|
||||
|
||||
&__search-list-open {
|
||||
margin: 24px;
|
||||
box-shadow: none;
|
||||
|
Loading…
Reference in New Issue
Block a user