According to https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState `visibilityState` is always a string, so the check was always true
}
nextWhenVisible() {
+ // FIXME TODO use `document.visibilityState`
// Don't call next when the page isn't visible
// or the carousel or its parent isn't visible
if (!document.hidden && isVisible(this._element)) {
if (this._config.interval && !this._isPaused) {
this._updateInterval()
- this._interval = setInterval(
- (document.visibilityState ? this.nextWhenVisible : this.next).bind(this),
- this._config.interval
- )
+ this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval)
}
}