Tasks: add a11y title and aria labels for Toolbar

master
Andrew P Maney 5 years ago committed by Tom Hacohen
parent 212dfc7095
commit 39529e66c1

@ -108,7 +108,7 @@ export default function Toolbar(props: PropsType) {
</Transition> </Transition>
<div className={classes.button}> <div className={classes.button}>
<IconButton size="small" onClick={toggleSearchField}> <IconButton size="small" onClick={toggleSearchField} title={showSearchField ? 'Close' : 'Search'}>
{showSearchField ? <CloseIcon /> : <SearchIcon />} {showSearchField ? <CloseIcon /> : <SearchIcon />}
</IconButton> </IconButton>
</div> </div>
@ -116,14 +116,16 @@ export default function Toolbar(props: PropsType) {
<div className={classes.button}> <div className={classes.button}>
<IconButton <IconButton
size="small" size="small"
aria-label="more" title="Sort"
aria-controls="long-menu" aria-label="Sort"
aria-controls="sort-menu"
aria-haspopup="true" aria-haspopup="true"
onClick={(e) => setSortAnchorEl(e.currentTarget)} onClick={(e) => setSortAnchorEl(e.currentTarget)}
> >
<SortIcon /> <SortIcon />
</IconButton> </IconButton>
<Menu <Menu
id="sort-menu"
anchorEl={sortAnchorEl} anchorEl={sortAnchorEl}
keepMounted keepMounted
open={!!sortAnchorEl} open={!!sortAnchorEl}
@ -140,14 +142,16 @@ export default function Toolbar(props: PropsType) {
<div className={classes.button}> <div className={classes.button}>
<IconButton <IconButton
size="small" size="small"
aria-label="more" title="Options"
aria-controls="long-menu" aria-label="Options"
aria-controls="options-menu"
aria-haspopup="true" aria-haspopup="true"
onClick={(e) => setOptionsAnchorEl(e.currentTarget)} onClick={(e) => setOptionsAnchorEl(e.currentTarget)}
> >
<MoreVertIcon /> <MoreVertIcon />
</IconButton> </IconButton>
<Menu <Menu
id="options-menu"
anchorEl={optionsAnchorEl} anchorEl={optionsAnchorEl}
keepMounted keepMounted
open={!!optionsAnchorEl} open={!!optionsAnchorEl}

Loading…
Cancel
Save