diff --git a/packages/ui-alerts/src/Alert/v2/README.md b/packages/ui-alerts/src/Alert/v2/README.md index a1c9e5c409..397a1a109b 100644 --- a/packages/ui-alerts/src/Alert/v2/README.md +++ b/packages/ui-alerts/src/Alert/v2/README.md @@ -250,6 +250,7 @@ type: embed aria-live="polite" alerts will only be announced if the user is not currently doing anything. Polite should be used in most situations involving live regions that present new info to users aria-live="assertive" alerts will be announced to the user as soon as possible, but not necessarily immediately. Assertive should be used if there is information that a user must know about right away, for example, a warning message in a form that does validation on the fly The aria-atomic=BOOLEAN is used to set whether or not the screen reader should always present the live region as a whole, even if only part of the region changes. The possible settings are: false or true. The default setting is false. + If the `liveRegion` element has a `role`, match it to the `liveRegionPoliteness` level: use `role="status"` for `polite` and `role="alert"` for `assertive`. ``` diff --git a/packages/ui-alerts/src/Alert/v2/index.tsx b/packages/ui-alerts/src/Alert/v2/index.tsx index 510de2e32b..bbb8af133a 100644 --- a/packages/ui-alerts/src/Alert/v2/index.tsx +++ b/packages/ui-alerts/src/Alert/v2/index.tsx @@ -153,11 +153,6 @@ class Alert extends Component { } initLiveRegion(liveRegion: Element) { - error( - liveRegion.getAttribute('role') === 'alert', - `[Alert] live region must have role='alert' set on page load in order to announce content` - ) - if (liveRegion) { liveRegion.setAttribute('aria-live', this.props.liveRegionPoliteness!) // indicates what notifications the user agent will trigger when the