kopia lustrzana https://github.com/shoelace-style/shoelace
remove redundant role
rodzic
b98b10c580
commit
a24eaa6693
|
@ -8,6 +8,8 @@ _During the beta period, these restrictions may be relaxed in the event of a mis
|
||||||
|
|
||||||
## Next
|
## Next
|
||||||
|
|
||||||
|
- Moved `role` from the shadow root to the host element in `<sl-menu>`
|
||||||
|
- Removed redundant `role="menu"` in `<sl-dropdown>`
|
||||||
- Slightly faster animations for showing and hiding `<sl-dropdown>`
|
- Slightly faster animations for showing and hiding `<sl-dropdown>`
|
||||||
|
|
||||||
## 2.0.0-beta.60
|
## 2.0.0-beta.60
|
||||||
|
|
|
@ -425,7 +425,6 @@ export default class SlDropdown extends LitElement {
|
||||||
<div
|
<div
|
||||||
part="panel"
|
part="panel"
|
||||||
class="dropdown__panel"
|
class="dropdown__panel"
|
||||||
role="menu"
|
|
||||||
aria-hidden=${this.open ? 'false' : 'true'}
|
aria-hidden=${this.open ? 'false' : 'true'}
|
||||||
aria-labelledby=${this.componentId}
|
aria-labelledby=${this.componentId}
|
||||||
>
|
>
|
||||||
|
|
|
@ -26,6 +26,10 @@ export default class SlMenu extends LitElement {
|
||||||
private typeToSelectString = '';
|
private typeToSelectString = '';
|
||||||
private typeToSelectTimeout: any;
|
private typeToSelectTimeout: any;
|
||||||
|
|
||||||
|
firstUpdated() {
|
||||||
|
this.setAttribute('role', 'menu');
|
||||||
|
}
|
||||||
|
|
||||||
getAllItems(options: { includeDisabled: boolean } = { includeDisabled: true }) {
|
getAllItems(options: { includeDisabled: boolean } = { includeDisabled: true }) {
|
||||||
return [...this.defaultSlot.assignedElements({ flatten: true })].filter((el: HTMLElement) => {
|
return [...this.defaultSlot.assignedElements({ flatten: true })].filter((el: HTMLElement) => {
|
||||||
if (el.getAttribute('role') !== 'menuitem') {
|
if (el.getAttribute('role') !== 'menuitem') {
|
||||||
|
@ -183,7 +187,6 @@ export default class SlMenu extends LitElement {
|
||||||
<div
|
<div
|
||||||
part="base"
|
part="base"
|
||||||
class="menu"
|
class="menu"
|
||||||
role="menu"
|
|
||||||
@click=${this.handleClick}
|
@click=${this.handleClick}
|
||||||
@keydown=${this.handleKeyDown}
|
@keydown=${this.handleKeyDown}
|
||||||
@keyup=${this.handleKeyUp}
|
@keyup=${this.handleKeyUp}
|
||||||
|
|
Ładowanie…
Reference in New Issue