Skip to content

Commit

Permalink
fix: Fix reusing region elements in UITextDisplayer (#6476)
Browse files Browse the repository at this point in the history
Fixes #6341
  • Loading branch information
avelad committed Apr 24, 2024
1 parent 84b2f8e commit 4302a6b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/text/ui_text_displayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ shaka.text.UITextDisplayer = class {
const cueRegistry = this.currentCuesMap_.get(cue);
goog.asserts.assert(cueRegistry, 'cueRegistry should exist.');
if (cueRegistry.regionElement) {
if (cueRegistry.regionElement.contains(container)) {
cueRegistry.regionElement.removeChild(container);
}
container.appendChild(cueRegistry.regionElement);
cueRegistry.regionElement.appendChild(cueRegistry.cueElement);
} else {
Expand Down

0 comments on commit 4302a6b

Please sign in to comment.