-
Notifications
You must be signed in to change notification settings - Fork 32
Update: Alert screen reader users when content has been added (fixes #232) #233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…urn childrenAdded from controller continue()
| async announceContentLoaded() { | ||
| const globals = Adapt.course.get('_globals'); | ||
| const message = globals?._extensions?._trickle?.additionalContentLoaded; | ||
| if (!message) return; | ||
| notify.create({ _type: 'a11y-push', body: message }); | ||
|
|
||
| // Allow time enough for the message to be read before focusing. | ||
| // Rough estimate: 200ms per word + buffer | ||
| const words = message.split(' ').length; | ||
| const delay = (words * 200) + 300; | ||
| return new Promise(resolve => setTimeout(resolve, delay)); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| async announceContentLoaded() { | |
| const globals = Adapt.course.get('_globals'); | |
| const message = globals?._extensions?._trickle?.additionalContentLoaded; | |
| if (!message) return; | |
| notify.create({ _type: 'a11y-push', body: message }); | |
| // Allow time enough for the message to be read before focusing. | |
| // Rough estimate: 200ms per word + buffer | |
| const words = message.split(' ').length; | |
| const delay = (words * 200) + 300; | |
| return new Promise(resolve => setTimeout(resolve, delay)); | |
| } | |
| async announceContentLoaded() { | |
| const globals = Adapt.course.get('_globals'); | |
| const message = globals?._extensions?._trickle?.additionalContentLoaded; | |
| if (!message) return; | |
| await notify.read(message); | |
| } |
Can you try the above with the following pr, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on a few question components. This seems to work if the user is required to click the Trickle button to continue. However, if not showing the Trickle button, it's hit or miss. Usually, the focus immediately goes to the Show Correct Answer button (or disabled Submit) and that is read out. So, we never hear "Loading." I'm using auto scroll in both cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that is irritating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you try it with all three of these prs please?
adaptlearning/adapt-contrib-core#673
adaptlearning/adapt-contrib-core#677
adaptlearning/adapt-contrib-core#679
Co-authored-by: Oliver Foster <[email protected]>
🚧 Work in progress 🚧
Fixes #232
Update
_globals._extensions._trickle.additionalContentLoadedin course.jsonFix
Testing