1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-07 18:03:48 +00:00

[a11y] dir view: enable 'keyboard access' for 'Tags'

This commit is contained in:
llj
2021-09-26 15:50:28 +08:00
parent c3273ddc52
commit f7e5fe2024
2 changed files with 10 additions and 3 deletions

View File

@@ -36,6 +36,12 @@ class RepoViewToolbar extends React.Component {
this.setState({ isOpen: !this.state.isOpen });
}
onDropdownToggleKeyDown = (e) => {
if (e.key == 'Enter' || e.key == 'Space') {
this.toggleMore();
}
}
visitDeletedviaKey = (e) => {
if (e.key == 'Enter' || e.key == 'Space') {
navigate(`${siteRoot}my-libs/deleted/`);
@@ -53,7 +59,7 @@ class RepoViewToolbar extends React.Component {
<i className="fas fa-plus-square text-secondary mr-1"></i>{gettext('New Library')}
</button>
<Dropdown isOpen={this.state.isOpen} toggle={this.toggleMore}>
<DropdownToggle className='btn btn-secondary operation-item'>
<DropdownToggle className='btn btn-secondary operation-item' onKeyDown={this.onDropdownToggleKeyDown}>
{gettext('More')}
</DropdownToggle>
<DropdownMenu>