Skip to content

Commit

Permalink
fix: move media-chrome-button aria attributes to connectedCallback fo…
Browse files Browse the repository at this point in the history
…r react compat.
  • Loading branch information
cjpillsbury committed Sep 27, 2021
1 parent 846aa82 commit b6b57b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/media-chrome-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ class MediaChromeButton extends window.HTMLElement {

const buttonHTML = template.content.cloneNode(true);
this.nativeEl = buttonHTML.querySelector('div');

this.setAttribute('role', "button");
this.setAttribute('aria-live', "polite");
this.setAttribute('tabindex', 0);

// Slots
let slotTemplate = options.slotTemplate;
Expand Down Expand Up @@ -154,6 +150,10 @@ class MediaChromeButton extends window.HTMLElement {
}

connectedCallback() {
this.setAttribute('role', "button");
this.setAttribute('aria-live', "polite");
this.setAttribute('tabindex', 0);

const mediaControllerId = this.getAttribute(MediaUIAttributes.MEDIA_CONTROLLER);
if (mediaControllerId) {
const mediaControllerEl = document.getElementById(mediaControllerId);
Expand Down

0 comments on commit b6b57b6

Please sign in to comment.