Skip to content

Commit

Permalink
fix(time-display): fix IE11 appending times instead of replacing (#7059)
Browse files Browse the repository at this point in the history
IE11 only supports HTMLElement and not text nodes in the contains
method. See https://developer.mozilla.org/en-US/docs/Web/API/Node/contains
Instead, compare firstChild.
  • Loading branch information
gkatsev authored Jan 22, 2021
1 parent dceedb6 commit ed3c54d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/control-bar/time-controls/time-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class TimeDisplay extends Component {

let oldNode = this.textNode_;

if (oldNode && !this.contentEl_.contains(oldNode)) {
if (oldNode && this.contentEl_.firstChild !== oldNode) {
oldNode = null;

log.warn('TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.');
Expand Down

0 comments on commit ed3c54d

Please sign in to comment.