Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/ui-alerts/src/Alert/v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ type: embed
<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>
<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>
<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>
<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>
</Figure>
</Guidelines>
```
5 changes: 0 additions & 5 deletions packages/ui-alerts/src/Alert/v2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ class Alert extends Component<AlertProps, AlertState> {
}

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
Expand Down
Loading