Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick H. Lauke <redux@splintered.co.uk>2016-02-16 17:16:27 +0300
committerPatrick H. Lauke <redux@splintered.co.uk>2016-02-16 17:29:59 +0300
commita496cb8be4dd1ccd4610e06f425153c76defc594 (patch)
tree5520c83673346269854f62404ea45bd21b21a909 /js/src/button.js
parent9b4cfdceda2598184f6ba05ea223f5359822ffcd (diff)
Focus (visually hidden) input radio/checkbox
This allows for keyboard navigation (e.g. arrow keys left/right to trigger different radio buttons) following an initial mouse click interaction
Diffstat (limited to 'js/src/button.js')
-rw-r--r--js/src/button.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/js/src/button.js b/js/src/button.js
index 3144a3f101..adcf4c9286 100644
--- a/js/src/button.js
+++ b/js/src/button.js
@@ -92,7 +92,10 @@ const Button = (($) => {
input.checked = !$(this._element).hasClass(ClassName.ACTIVE)
$(this._element).trigger('change')
}
+
+ $(input).trigger('focus')
}
+
} else {
this._element.setAttribute('aria-pressed',
!$(this._element).hasClass(ClassName.ACTIVE))