Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Comments

a11y: add announcement region to app and announce copy/deletion#2643

Merged
corinagum merged 19 commits intomasterfrom
beyackle/tableAnnounce
Apr 15, 2020
Merged

a11y: add announcement region to app and announce copy/deletion#2643
corinagum merged 19 commits intomasterfrom
beyackle/tableAnnounce

Conversation

@beyackle
Copy link
Contributor

Description

This creates an aria-live region that should be reading off announcements when an item in the Bot Responses table is duplicated or deleted. For some reason, though, it isn't.

Task Item

closes #2050

Screenshots

The new div, present in the page DOM:
image

@github-actions
Copy link

Coverage Status

Coverage decreased (-0.03%) to 41.417% when pulling b19e38a on beyackle/tableAnnounce into 5096a30 on master.

@beyackle
Copy link
Contributor Author

I think I see the problem. The aria-live region, since it's inside a subpage that gets dynamically loaded, isn't being seen by the screen reader. That means it has to be somewhere outside the table, but the table has to be able to stick announcements into it.

Comment on lines +50 to +52
_async.setTimeout(() => {
setMessage(undefined);
}, 2000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How this setTimeout works?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will reset the message to "undefined" after two seconds. Because the "aria-live" region is only read when it changes, we need to clear the message out after a pause. Otherwise doing the same action multiple times in a row (like deleting two rows from the table) will only be read once.

@beyackle beyackle marked this pull request as ready for review April 15, 2020 19:58
@beyackle beyackle changed the title a11y: [DRAFT] add announcements to table view a11y: add announcement region to app and announce copy/deletion Apr 15, 2020
@corinagum corinagum self-assigned this Apr 15, 2020
aria-live="assertive"
style={{
position: 'absolute',
left: '-9999px',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

speaking from past experience, hiding the div way off to one side of the screen will cause scrollbar problems if/when RTL is brought into the mix. My suggestion would be to put it above the screen and/or change the div to 1x1 with no overflow to avoid the possibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. I figured there'd be a better way to do that.

Copy link
Contributor

@corinagum corinagum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@corinagum corinagum merged commit 9f85a17 into master Apr 15, 2020
@corinagum corinagum deleted the beyackle/tableAnnounce branch April 15, 2020 21:17
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
…osoft#2643)

* add announcements to table view

* linter stuff

* use global context for announcement state

* add announcements to table view

* linter stuff

* use global context for announcement state

* add announcements to table view

* linter stuff

* use global context for announcement state

* Update table-view.tsx

* Update App.tsx
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants