Skip to content

@fabwcie/free-drawing / utils/liveRegion

utils/liveRegion ​

Functions ​

announce() ​

announce($region, message, urgent): void

Defined in: packages/free-drawing/src/utils/liveRegion.ts:29

Message read by screen readers: added to a live region (see createLiveRegion), removed after a while

Parameters

$region

HTMLElement

Live region (of the drawer or of the dialog shown)

message

string

Text read

urgent

boolean

Read at once (problems), else when the user is idle

Returns

void


createLiveRegion() ​

createLiveRegion(): HTMLDivElement

Defined in: packages/free-drawing/src/utils/liveRegion.ts:9

Live region read by screen readers (messages of toasts), kept in the page: a region added with its text is not always announced. One in the drawer, one in each dialog (out of an aria-modal dialog shown, nothing is read)

Returns

HTMLDivElement

Visually hidden element holding a polite region (status) and an urgent one (alert)