-
+ Users}>
Users
@@ -99,7 +104,9 @@ class SimpleTabs extends React.Component {
### With tooltip react ref
-When using a React ref to link a Tooltip to a Tab component, an `id` must be manually set on the Tooltip component, and the Tab component must have a matching `aria-describedby` attribute so that screen readers are able to announce the Tooltip contents.
+When using a React ref to link a Tooltip to a Tab component via the `reference` prop, you should avoid manually passing in a value of "off" to the `aria-live` prop. Doing so may lead to the tooltip becoming less accessible to assistive technologies.
+
+The tooltip should also have the `id` prop passed in. The value given to this prop should then be passed into the tab's `aria-describedby` prop. This ensures a tooltip used with a React ref will be announced by the JAWS and NVDA screen readers.
```js
import React from 'react';
@@ -132,7 +139,12 @@ class SimpleTabs extends React.Component {
return (
diff --git a/packages/react-core/src/components/Tooltip/Tooltip.tsx b/packages/react-core/src/components/Tooltip/Tooltip.tsx
index 3ff65e1772e..dbe0927c6e0 100644
--- a/packages/react-core/src/components/Tooltip/Tooltip.tsx
+++ b/packages/react-core/src/components/Tooltip/Tooltip.tsx
@@ -35,6 +35,12 @@ export interface TooltipProps extends Omit, 'con
* If you don't want that or prefer to add the aria attribute yourself on the trigger, set aria to 'none'.
*/
aria?: 'describedby' | 'labelledby' | 'none';
+ /**
+ * Determines whether the tooltip is an aria-live region. If the reference prop is passed in the
+ * default behavior is 'polite' in order to ensure the tooltip contents is announced to
+ * assistive technologies. Otherwise the default behavior is 'off'.
+ */
+ 'aria-live'?: 'off' | 'polite';
/**
* The reference element to which the Tooltip is relatively placed to.
* If you cannot wrap the reference with the Tooltip, you can use the reference prop instead.
@@ -155,6 +161,7 @@ export const Tooltip: React.FunctionComponent = ({
children,
animationDuration = 300,
reference,
+ 'aria-live': ariaLive = reference ? 'polite' : 'off',
boundary,
isAppLauncher,
tippyProps,
@@ -251,6 +258,7 @@ export const Tooltip: React.FunctionComponent = ({
const hasCustomMaxWidth = maxWidth !== tooltipMaxWidth.value;
const content = (
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id feugiat augue, nec fringilla turpis.
;
```
-### On icon
+### On icon with dynamic content
+
+When the tooltip is used as a wrapper and its content will dynamically update, the `aria` prop should have a value of "none" passed in. This prevents assistive technologies from announcing the tooltip contents more than once. Additionally, the `aria-live` prop should have a value of "polite" passed in, in order for assistive technologies to announce when the tooltip contents gets updated.
+
+When using a React or selector ref with a tooltip that has dynamic content, the `aria` and `aria-live` props do not need to be manually passed in.
+
```js
import React from 'react';
import { Tooltip, Button } from '@patternfly/react-core';
@@ -77,8 +95,13 @@ IconExample = () => {
const [content, setContent] = React.useState(copyText);
return (