2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-18 12:39:41 +03:00

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
This commit is contained in:
Patrick H. Lauke
2016-02-16 14:16:27 +00:00
parent 9b4cfdceda
commit a496cb8be4
+3
View 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))