Switch to DIV for swaps dropdown accessibility (#9732)

feature/default_network_editable
David Walsh 4 years ago committed by GitHub
parent 3bbc1d1fa4
commit 61e48b4a84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      ui/app/pages/swaps/dropdown-search-list/dropdown-search-list.js
  2. 5
      ui/app/pages/swaps/dropdown-search-list/index.scss

@ -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>
) )
} }

@ -1,9 +1,4 @@
.dropdown-search-list { .dropdown-search-list {
flex-flow: column;
border: none;
background: unset;
padding: 0;
&__search-list-open { &__search-list-open {
margin: 24px; margin: 24px;
box-shadow: none; box-shadow: none;

Loading…
Cancel
Save