Skip to content

Commit 240bcda

Browse files
committed
fix(ui-alerts): remove live region role warning
INSTUI-5131
1 parent 30c7251 commit 240bcda

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

packages/ui-alerts/src/Alert/v2/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ type: embed
250250
<Figure.Item>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</Figure.Item>
251251
<Figure.Item>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</Figure.Item>
252252
<Figure.Item>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.</Figure.Item>
253+
<Figure.Item>If the `liveRegion` element has a `role`, match it to the `liveRegionPoliteness` level: use `role="status"` for `polite` and `role="alert"` for `assertive`.</Figure.Item>
253254
</Figure>
254255
</Guidelines>
255256
```

packages/ui-alerts/src/Alert/v2/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,6 @@ class Alert extends Component<AlertProps, AlertState> {
153153
}
154154

155155
initLiveRegion(liveRegion: Element) {
156-
error(
157-
liveRegion.getAttribute('role') === 'alert',
158-
`[Alert] live region must have role='alert' set on page load in order to announce content`
159-
)
160-
161156
if (liveRegion) {
162157
liveRegion.setAttribute('aria-live', this.props.liveRegionPoliteness!)
163158
// indicates what notifications the user agent will trigger when the

0 commit comments

Comments
 (0)