mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-11 16:14:04 +02: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:
@@ -92,7 +92,10 @@ const Button = (($) => {
|
|||||||
input.checked = !$(this._element).hasClass(ClassName.ACTIVE)
|
input.checked = !$(this._element).hasClass(ClassName.ACTIVE)
|
||||||
$(this._element).trigger('change')
|
$(this._element).trigger('change')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(input).trigger('focus')
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this._element.setAttribute('aria-pressed',
|
this._element.setAttribute('aria-pressed',
|
||||||
!$(this._element).hasClass(ClassName.ACTIVE))
|
!$(this._element).hasClass(ClassName.ACTIVE))
|
||||||
|
Reference in New Issue
Block a user