Skip to content

Commit

Permalink
fix: rendition selected prop missing for re-render
Browse files Browse the repository at this point in the history
  • Loading branch information
luwes committed Sep 18, 2024
1 parent f96cce6 commit 1f8a55d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/js/menu/media-rendition-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ class MediaRenditionMenu extends MediaChromeMenu {
(a: any, b: any) => b.height - a.height
);

for (const rendition of renditionList) {
// `selected` is not serialized in the rendition list because
// each selection would cause a re-render of the menu.
// @ts-ignore
rendition.selected = rendition.id === this.mediaRenditionSelected;
}

this.defaultSlot.textContent = '';

const isAuto = !this.mediaRenditionSelected;
Expand Down

0 comments on commit 1f8a55d

Please sign in to comment.