1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-11 08:04:59 +02:00

Fix Toggle buttons don't honor [disabled] or .disabled

This commit is contained in:
Anna
2017-04-26 19:46:05 +03:00
committed by Johann-S
parent ab39defe74
commit 33715a73d2
2 changed files with 23 additions and 0 deletions

View File

@@ -90,6 +90,12 @@ const Button = (($) => {
}
if (triggerChangeEvent) {
if (input.hasAttribute('disabled') ||
rootElement.hasAttribute('disabled') ||
input.classList.contains('disabled') ||
rootElement.classList.contains('disabled')) {
return
}
input.checked = !$(this._element).hasClass(ClassName.ACTIVE)
$(input).trigger('change')
}