You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/4.0/components/tooltips.md
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,8 @@ The required markup for a tooltip is only a `data` attribute and `title` on the
94
94
##### Making tooltips work for keyboard and assistive technology users
95
95
96
96
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.
97
+
98
+
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.
97
99
{% endcallout %}
98
100
99
101
{% highlight html %}
@@ -111,11 +113,11 @@ You should only add tooltips to HTML elements that are traditionally keyboard-fo
111
113
112
114
### Disabled elements
113
115
114
-
Elements with the `disabled` attribute aren't interactive, meaning users cannot hover or click them to trigger a tooltip (or popover). As a workaround, you'll want to trigger the tooltip from a wrapper `<div>` or `<span>` and override the `pointer-events` on the disabled element.
116
+
Elements with the `disabled` attribute aren't interactive, meaning users cannot focus, hover, or click them to trigger a tooltip (or popover). As a workaround, you'll want to trigger the tooltip from a wrapper `<div>` or `<span>`, ideally made keyboard-focusable using `tabindex="0"`, and override the `pointer-events` on the disabled element.
@@ -192,7 +194,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
192
194
<p>Base HTML to use when creating the tooltip.</p>
193
195
<p>The tooltip's <code>title</code> will be injected into the <code>.tooltip-inner</code>.</p>
194
196
<p><code>.arrow</code> will become the tooltip's arrow.</p>
195
-
<p>The outermost wrapper element should have the <code>.tooltip</code> class.</p>
197
+
<p>The outermost wrapper element should have the <code>.tooltip</code> class and <code>role="tooltip"</code>.</p>
196
198
</td>
197
199
</tr>
198
200
<tr>
@@ -208,7 +210,11 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
208
210
<td>trigger</td>
209
211
<td>string</td>
210
212
<td>'hover focus'</td>
211
-
<td>How tooltip is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space. `manual` cannot be combined with any other trigger.</td>
213
+
<td>
214
+
<p>How tooltip is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space.</p>
215
+
<p><code>'manual'</code> indicates that the tooltip will be triggered programmatically via the <code>.tooltip('show')</code>, <code>.tooltip('hide')</code> and <code>.tooltip('toggle')</code> methods; this value cannot be combined with any other trigger.</p>
216
+
<p><code>'hover'</code> on its own will result in tooltips that cannot be triggered via the keyboard, and should only be used if alternative methods for conveying the same information for keyboard users is present.</p>
0 commit comments