aboutsummaryrefslogtreecommitdiff
path: root/js/src/tab.js
diff options
context:
space:
mode:
authorPatrick H. Lauke <[email protected]>2021-03-17 08:52:40 +0000
committerGitHub <[email protected]>2021-03-17 10:52:40 +0200
commit3ce0a8d3ecc05ac43fa5f5da0c5fc1aaea7742d5 (patch)
tree401b22206ceef2f6701dc336edae13dd71726d82 /js/src/tab.js
parentb9f30903a5a916904c873bd078240b3df743e093 (diff)
downloadbootstrap-3ce0a8d3ecc05ac43fa5f5da0c5fc1aaea7742d5.tar.xz
bootstrap-3ce0a8d3ecc05ac43fa5f5da0c5fc1aaea7742d5.zip
Dynamic tab should not show when triggered on `disabled` element (#33257)
* show() should bail if the trigger has `disabled` attribute * use 'isDisabled' helper Co-authored-by: GeoSot <[email protected]> Co-authored-by: XhmikosR <[email protected]>
Diffstat (limited to 'js/src/tab.js')
-rw-r--r--js/src/tab.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/src/tab.js b/js/src/tab.js
index 95968f4f8..ec3d790b0 100644
--- a/js/src/tab.js
+++ b/js/src/tab.js
@@ -10,6 +10,7 @@ import {
emulateTransitionEnd,
getElementFromSelector,
getTransitionDurationFromElement,
+ isDisabled,
reflow
} from './util/index'
import Data from './dom/data'
@@ -36,7 +37,6 @@ const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
const CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'
const CLASS_NAME_ACTIVE = 'active'
-const CLASS_NAME_DISABLED = 'disabled'
const CLASS_NAME_FADE = 'fade'
const CLASS_NAME_SHOW = 'show'
@@ -67,7 +67,7 @@ class Tab extends BaseComponent {
if ((this._element.parentNode &&
this._element.parentNode.nodeType === Node.ELEMENT_NODE &&
this._element.classList.contains(CLASS_NAME_ACTIVE)) ||
- this._element.classList.contains(CLASS_NAME_DISABLED)) {
+ isDisabled(this._element)) {
return
}