1
0
mirror of https://github.com/videojs/video.js.git synced 2025-02-04 11:43:27 +02:00

fix(time-display): fix IE11 appending times instead of replacing (#7059)

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.
This commit is contained in:
Gary Katsevman 2021-01-22 13:55:58 -05:00 committed by GitHub
parent dceedb6746
commit ed3c54d13a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.');