1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-29 06:49:06 +02:00

Fix JS components console error "Error: <Component> is transitioning"

This commit is contained in:
Pierre Vanduynslager
2017-03-28 17:43:16 -04:00
committed by Johann-S
parent ce0e2f8e76
commit 48c5efa4c3
16 changed files with 101 additions and 155 deletions

View File

@@ -120,11 +120,8 @@ const Collapse = (($) => {
}
show() {
if (this._isTransitioning) {
throw new Error('Collapse is transitioning')
}
if ($(this._element).hasClass(ClassName.SHOW)) {
if (this._isTransitioning ||
$(this._element).hasClass(ClassName.SHOW)) {
return
}
@@ -204,11 +201,8 @@ const Collapse = (($) => {
}
hide() {
if (this._isTransitioning) {
throw new Error('Collapse is transitioning')
}
if (!$(this._element).hasClass(ClassName.SHOW)) {
if (this._isTransitioning ||
!$(this._element).hasClass(ClassName.SHOW)) {
return
}