Skip to content

Commit

Permalink
refactor: set role attribute directly in template (#7318)
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen authored Apr 11, 2024
1 parent 7a4c80c commit ff30a54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
3 changes: 1 addition & 2 deletions packages/dialog/src/vaadin-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class Dialog extends DialogDraggableMixin(
<vaadin-dialog-overlay
id="overlay"
role="dialog"
header-title="[[headerTitle]]"
on-opened-changed="_onOverlayOpened"
on-mousedown="_bringOverlayToFront"
Expand Down Expand Up @@ -147,8 +148,6 @@ class Dialog extends DialogDraggableMixin(
ready() {
super.ready();

this._overlayElement.setAttribute('role', 'dialog');

processTemplates(this);
}

Expand Down
8 changes: 1 addition & 7 deletions packages/dialog/src/vaadin-lit-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Dialog extends DialogDraggableMixin(
return html`
<vaadin-dialog-overlay
id="overlay"
role="dialog"
.owner="${this}"
.opened="${this.opened}"
.headerTitle="${this.headerTitle}"
Expand All @@ -91,13 +92,6 @@ class Dialog extends DialogDraggableMixin(
></vaadin-dialog-overlay>
`;
}

/** @protected */
ready() {
super.ready();

this._overlayElement.setAttribute('role', 'dialog');
}
}

defineCustomElement(Dialog);
Expand Down

0 comments on commit ff30a54

Please sign in to comment.