fix(ui-alerts,console): remove Alert live-region role warning - #2664
fix(ui-alerts,console): remove Alert live-region role warning#2664ToMESSKa wants to merge 1 commit into
Conversation
|
Visual regression report
Diff images (33)alert.png — baseline no longer producedavatar.png — baseline no longer producedbadge.png — baseline no longer producedbillboard.png — baseline no longer producedbreadcrumb.png — baseline no longer producedbutton-and-derivatives.png — baseline no longer producedbyline.png — baseline no longer producedcalendar.png — baseline no longer producedcheckbox.png — baseline no longer producedcheckboxgroup.png — baseline no longer producedcolorpicker.png — baseline no longer producedcontextview.png — baseline no longer producedcustom-and-lucide-icons.png — baseline no longer produceddateinput-dateinput2.png — baseline no longer produceddatetimeinput.png — baseline no longer produceddiff-demo.png — 6324 pixels differdrilldown.png — baseline no longer producedfiledrop.png — baseline no longer producedform-errors.png — baseline no longer producedheading.png — baseline no longer producedimg.png — baseline no longer producedlink.png — baseline no longer producedmenu.png — baseline no longer producedmetric-pill-tag-timeselect-text.png — baseline no longer producedoptions.png — baseline no longer producedpagination.png — baseline no longer producedprogressbar.png — baseline no longer producedselect-simpleselect.png — baseline no longer producedtable.png — baseline no longer producedtabs.png — baseline no longer producedtooltip.png — baseline no longer producedtreebrowser.png — baseline no longer producedview.png — baseline no longer producedBaselines come from the |
53103e2 to
240bcda
Compare
| <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> |
There was a problem hiding this comment.
hmm this is not the best description, its more complicated. Please add this:
<Figure.Item>
For the liveRegion DOM element, note that the role prop adds implicit ARIA attributes, but these are not applied, unless you set liveRegionPoliteness or isLiveRegionAtomic to undefined.
</Figure.Item>
There was a problem hiding this comment.
@matyasf liveRegionPoliteness and isLiveRegionAtomic both have default values.
65 static defaultProps = {
...
72 liveRegionPoliteness: 'assertive',
73 isLiveRegionAtomic: false,
...
76 }
So aria-live and aria-atomic are always explicitly set even if these props are undefined, e.g.:
<div>
<div className="alerts-container" id="live-region"></div>
<Alert
variant="info"
renderCloseButtonLabel="Dismiss alert"
liveRegion={() => document.getElementById("live-region")}
>
Just an alert.
</Alert>
</div>
There was a problem hiding this comment.
hmm, good catch with the defaults. An explicit aria-live overrides the role's implicit value: <div role="alert" aria-live="polite"> is announced politely.
so a better description here would be:
<Figure.Item>Do not set therole prop on the liveRegion because liveRegionPoliteness and isLiveRegionAtomic overrides the set values.</Figure.Item>
@ToMESSKa no need for you to be working on this ticket, Nandi has taken it over

INSTUI-5131
ISSUE:
role="alert"added to live region #2276TEST PLAN:
packages/__docs__/src/index.htmlafter line 4 (webpack 5 doesn't provideprocessin the browser so typeof process resolves to "undefined" inpackages/console/src/console.tsand log messages are not emitted)