Having variables initialised from start `_isTransitioning` is better.
Would be better to add an eslint rule to check for undeclared variables use.
Reordered enter checks for `show` and `hide` by priority.
this._isShown = false
this._isBodyOverflowing = false
this._ignoreBackdropClick = false
+ this._isTransitioning = false
this._scrollbarWidth = 0
}
}
show(relatedTarget) {
- if (this._isTransitioning || this._isShown) {
+ if (this._isShown || this._isTransitioning) {
return
}
event.preventDefault()
}
- if (this._isTransitioning || !this._isShown) {
+ if (!this._isShown || this._isTransitioning) {
return
}
this._isShown = null
this._isBodyOverflowing = null
this._ignoreBackdropClick = null
+ this._isTransitioning = null
this._scrollbarWidth = null
}