-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(overflow-menu): improve overall a11y
- Loading branch information
Showing
2 changed files
with
39 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,40 @@ | ||
<div data-overflow-menu tabindex="0" aria-label="Overflow menu description" class="bx--overflow-menu"> | ||
<svg class="bx--overflow-menu__icon" width="3" height="15" viewBox="0 0 3 15"> | ||
<div data-overflow-menu tabindex="0" aria-label="Overflow" class="bx--overflow-menu" role="button" aria-haspopup="true" | ||
aria-expanded="false"> | ||
<svg aria-hidden="true" class="bx--overflow-menu__icon" width="3" height="15" viewBox="0 0 3 15"> | ||
<g fill-rule="evenodd"> | ||
<circle cx="1.5" cy="1.5" r="1.5" /> | ||
<circle cx="1.5" cy="7.5" r="1.5" /> | ||
<circle cx="1.5" cy="13.5" r="1.5" /> | ||
</g> | ||
</svg> | ||
<ul class="bx--overflow-menu-options" tabindex="-1" data-floating-menu-direction="{{direction}}"> | ||
<ul class="bx--overflow-menu-options" tabindex="-1" role="menu" aria-label="Overflow" data-floating-menu-direction="{{direction}}"> | ||
{{#each items}} | ||
<li class="bx--overflow-menu-options__option{{#if disabled}} bx--overflow-menu-options__option--disabled{{/if}}{{#if danger}} bx--overflow-menu-options__option--danger{{/if}}"> | ||
<button class="bx--overflow-menu-options__btn"{{#if title}} title="{{title}}"{{/if}}{{#if primaryFocus}} data-floating-menu-primary-focus{{/if}}{{#if disabled}} tabindex="-1"{{/if}}>{{label}}</button> | ||
</li> | ||
<li class="bx--overflow-menu-options__option{{#if disabled}} bx--overflow-menu-options__option--disabled{{/if}}{{#if danger}} bx--overflow-menu-options__option--danger{{/if}}" | ||
role="presentation"> | ||
<button class="bx--overflow-menu-options__btn" role="menuitem" {{#if title}} title="{{title}}" {{/if}} | ||
{{#if primaryFocus}} data-floating-menu-primary-focus{{/if}}{{#if disabled}} tabindex="-1" {{/if}}>{{label}}</button> | ||
</li> | ||
{{/each}} | ||
</ul> | ||
</div> | ||
|
||
<div data-overflow-menu tabindex="0" aria-label="Overflow menu description" class="bx--overflow-menu"> | ||
<svg class="bx--overflow-menu__icon" width="3" height="15" viewBox="0 0 3 15"> | ||
<div data-overflow-menu tabindex="0" aria-label="Overflow" class="bx--overflow-menu" role="button" aria-haspopup="true" | ||
aria-expanded="false"> | ||
<svg aria-hidden="true" class="bx--overflow-menu__icon" width="3" height="15" viewBox="0 0 3 15"> | ||
<g fill-rule="evenodd"> | ||
<circle cx="1.5" cy="1.5" r="1.5" /> | ||
<circle cx="1.5" cy="7.5" r="1.5" /> | ||
<circle cx="1.5" cy="13.5" r="1.5" /> | ||
</g> | ||
</svg> | ||
<ul class="bx--overflow-menu-options bx--overflow-menu--flip" tabindex="-1" data-floating-menu-direction="{{direction}}"> | ||
<ul class="bx--overflow-menu-options bx--overflow-menu--flip" tabindex="-1" data-floating-menu-direction="{{direction}}" | ||
role="menu" aria-label="Overflow"> | ||
{{#each items}} | ||
<li class="bx--overflow-menu-options__option{{#if disabled}} bx--overflow-menu-options__option--disabled{{/if}}{{#if danger}} bx--overflow-menu-options__option--danger{{/if}}"> | ||
<button class="bx--overflow-menu-options__btn"{{#if title}} title="{{title}}"{{/if}}{{#if primaryFocus}} data-floating-menu-primary-focus{{/if}}{{#if disabled}} tabindex="-1"{{/if}}>{{label}}</button> | ||
</li> | ||
<li class="bx--overflow-menu-options__option{{#if disabled}} bx--overflow-menu-options__option--disabled{{/if}}{{#if danger}} bx--overflow-menu-options__option--danger{{/if}}" | ||
role="presentation"> | ||
<button class="bx--overflow-menu-options__btn" role="menuitem" {{#if title}} title="{{title}}" {{/if}} | ||
{{#if primaryFocus}} data-floating-menu-primary-focus{{/if}}{{#if disabled}} tabindex="-1" {{/if}}>{{label}}</button> | ||
</li> | ||
{{/each}} | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters