mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-11 18:02:28 +03:00
Docs: add accessibility/keyboard callout to popovers, tweak tooltips callout (#28851)
- Add same advice about keyboard/AT handling to popovers as a callout; also add information about not adding excessive content or interactive controls (and the suggestion to opt for a modal) - Tweak the tooltips callout for consistency
This commit is contained in:
committed by
XhmikosR
parent
911b72cf78
commit
5bf876cb0f
@@ -107,9 +107,7 @@ The required markup for a tooltip is only a `data` attribute and `title` on the
|
||||
{% capture callout %}
|
||||
##### Making tooltips work for keyboard and assistive technology users
|
||||
|
||||
You should only add tooltips to HTML elements that are traditionally keyboard-focusable and interactive (such as links or form controls). Although arbitrary HTML elements (such as `<span>`s) can be made focusable by adding the `tabindex="0"` attribute, this will add potentially annoying and confusing tab stops on non-interactive elements for keyboard users. In addition, most assistive technologies currently do not announce the tooltip in this situation.
|
||||
|
||||
Additionally, do not rely solely on `hover` as the trigger for your tooltip, as this will make your tooltips impossible to trigger for keyboard users.
|
||||
You should only add tooltips to HTML elements that are traditionally keyboard-focusable and interactive (such as links or form controls). Although arbitrary HTML elements (such as `<span>`s) can be made focusable by adding the `tabindex="0"` attribute, this will add potentially annoying and confusing tab stops on non-interactive elements for keyboard users, and most assistive technologies currently do not announce the tooltip in this situation. Additionally, do not rely solely on `hover` as the trigger for your tooltip, as this will make your tooltips impossible to trigger for keyboard users.
|
||||
{% endcapture %}
|
||||
{% include callout.html content=callout type="warning" %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user