search-widget(aria-live) status for results found#77031
Conversation
- We would like to notify the user about the results we found the screen reader will read out the number of results or no result aria-live is added at load, as it cannot be added adhoc
| label = NLS_NO_RESULTS; | ||
| } | ||
| this._matchesCount.appendChild(document.createTextNode(label)); | ||
| let myAlert = document.createElement('div'); |
There was a problem hiding this comment.
Why do we need to introduce a div element? Can you please explain that.
There was a problem hiding this comment.
Also if we decide this this is need myAlert should be a const not a let
There was a problem hiding this comment.
Why do we need to introduce a
divelement? Can you please explain that.
- aria-live - seems to need a change, beyond just a text update. Without the DIV, the reading of aria-live is not consistent
- I investigated to review the accessibility tree - for clues as to why, but it does not seem that there is anyway to access the
*. chrome://accessibility/
**. accessibility tab - in the Element inspector is not available
I will try to install this tool - to review it for any clues
https://electronjs.org/docs/tutorial/accessibility#devtron
There was a problem hiding this comment.
the extra div element - is needed, since normal text changes to the DOM are not enough
https://github.com/microsoft/vscode/blob/master/src/vs/base/browser/ui/aria/aria.ts#L58
| this._matchesCount = document.createElement('div'); | ||
| this._matchesCount.className = 'matchesCount'; | ||
|
|
||
| this._matchesCount.setAttribute('role', 'alert'); |
There was a problem hiding this comment.
role: alert and aria-live: assertive should be equivalelnt based on the W3 spec
Does it still work if we use only one of these?
|
@georgebatalinski thank you very much for you PR. @rebornix can you please take this over, since from tommorow I am on a 15 day vacation. I just did an initial review. |
|
@rebornix let me know your thoughts |
|
@isidorn @rebornix after doing some research - it seems we have a way to add an populate Solutions:
|
|
@georgebatalinski thanks for your help on this. I played with the code change and it works as expected. Regarding the two solutions you proposed, I found that option #2 actually works the same as I'll suggest to simply use |
|
In addition to that, to make the alert more descriptive, we can probably alert Test cases I run manually: Text Document
Above information can be found by reading @georgebatalinski let me know if you need me to make some updates directly ;) |
| this._matchesCount = document.createElement('div'); | ||
| this._matchesCount.className = 'matchesCount'; | ||
|
|
||
| this._matchesCount.setAttribute('aria-live', 'assertive'); |
There was a problem hiding this comment.
If we use aria.alert, then this is no longer necessary, right?
- We use alert from aria base
|
@rebornix let me know if it works on your side as expected (It does on mine :) |
|
LGTM. thanks! |
|
@georgebatalinski @rebornix Great work! Thanks a lot! |
the screen reader will read out the number of results or no result
aria-live is added at load, as it cannot be added adhoc
Proposal for Issue - #69741