AriaLiveAnnouncer
class
An accessibility helper that manages all ARIA live regions associated with an editor instance. ARIA live regions announce changes to the state of the editor features.
These announcements are consumed and propagated by screen readers and give users a better understanding of the current state of the editor.
To announce a state change to an editor use the announce method:
editor.ui.ariaLiveAnnouncer.announce( 'Text of an announcement.' );
Copy code
Properties
-
module:ui/arialiveannouncer~AriaLiveAnnouncer#editorThe editor instance.
-
view : AriaLiveAnnouncerView | undefinedmodule:ui/arialiveannouncer~AriaLiveAnnouncer#viewThe view that aggregates all
aria-liveregions.
Methods
-
constructor( editor )module:ui/arialiveannouncer~AriaLiveAnnouncer#constructor -
announce( announcement, attributes ) → voidmodule:ui/arialiveannouncer~AriaLiveAnnouncer#announceSets an announcement text to an aria region that is then announced by a screen reader to the user.
If the aria region of a specified politeness does not exist, it will be created and can be re-used later.
The default announcement politeness level is
'polite'.// Most screen readers will queue announcements from multiple aria-live regions and read them out in the order they were emitted. * editor.ui.ariaLiveAnnouncer.announce( 'Image uploaded.' ); * editor.ui.ariaLiveAnnouncer.announce( 'Connection lost. Reconnecting.' ); * ```Copy codeParameters
announcement : stringattributes : AriaLiveAnnouncerPolitenessValue | AriaLiveAnnounceConfig-
Defaults to
AriaLiveAnnouncerPoliteness.POLITE
Returns
void