]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Focus (visually hidden) input radio/checkbox 19222/head
authorPatrick H. Lauke <redux@splintered.co.uk>
Tue, 16 Feb 2016 14:16:27 +0000 (14:16 +0000)
committerPatrick H. Lauke <redux@splintered.co.uk>
Tue, 16 Feb 2016 14:29:59 +0000 (14:29 +0000)
This allows for keyboard navigation (e.g. arrow keys left/right to
trigger different radio buttons) following an initial mouse click
interaction

js/src/button.js

index 3144a3f101230843d5d5c7177be5e22c3e1caab9..adcf4c92864f726df4cfb29f8a91f8b887ea648c 100644 (file)
@@ -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))