-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Settings: Focused input elements, values, modified state not read by screenreader #54836
Comments
@roblourens Also I confirmed that this behavior is relevant to all the controls within the tree. This means none of the check boxes or other controls get read out either. Given that there is a bunch of other content that might have aria issues , where do you want to capture that discussion? I am mainly thinking about the extended descriptions that expand when selected. Is that up for discussion? |
That sounds promising. Maybe these controls need to take a What I do about reading the descriptions, etc largely depends on the outcome of #54039. Maybe it goes into the aria-label for the setting item itself, or maybe we use |
I am going to add this as an option, otherwise we get nothing but we land on the select boxes. |
@roblourens Reverse example order... |
Yes you are welcome to work on it as much as you want! |
ARIA labeling within a tree gets tricky and appears to have quite a few either quirks I now have all controls reading the settings value when the input element gets focused. Example: Who is the ARIA guru ? Perhaps my solution is not the best practice. I could not find I have not addressed setting descriptions including embedded links. I figure it's better to wait Should I clean up and merge these changes in so at least we have some output? Probably will try to use private renderNumber(dataElement: SettingsTreeSettingElement, isSelected: boolean, template: ISettingTextItemTemplate, onChange: (value: number) => void): void {
template.onChange = null;
template.inputBox.value = dataElement.value;
template.onChange = value => onChange(parseFn(value));
template.inputBox.inputElement.tabIndex = isSelected ? 0 : -1;
const parseFn = dataElement.valueType === 'integer' ? parseInt : parseFloat;
// Setup and add ARIA attributes
// Create id and label for control/input element - parent is control div
const id = (dataElement.displayCategory + '_'+dataElement.displayLabel).replace(/ /g, '_');
const label = dataElement.displayCategory + ' ' + dataElement.displayLabel + ' number selected ' + dataElement.value + ' ' + template.isConfiguredElement.textContent;
// We use the parent control div for the aria-labelledby target
// Does not appear you can use the direct label on the element itself within a tree
template.inputBox.inputElement.parentElement.setAttribute('id', id);
template.inputBox.inputElement.parentElement.setAttribute('aria-label',label);
// Labels will not be read on descendent input elements of the parent treeitem
// unless defined as role=treeitem and indirect aria-labelledby approach
template.inputBox.inputElement.setAttribute('role','treeitem');
template.inputBox.inputElement.setAttribute('aria-labelledby',id);
template.inputBox.inputElement.setAttribute('aria-readonly', 'true');
}
|
I think we are all just figuring it out as we go :) I would like to have those changes, thanks. Why |
Ahh, you spotted the one thing I didn't really comment on ! Besides the issue of input controls seemingly requiring role=treeitem, If you look at the label for the number input box example, I actually
I will get these changes in. After that, let me know if there's anything else for the milestone With read-only: Settings tree view Without read-only (only change) Settings tree view |
I'm worried about setting aria-readonly to trick the screenreader, when the control is editable. Reading "editable" does seem redundant, but if that's what users expect for an editable control, I think we should keep that. But I'm fine with the other changes. Thanks for the help! |
okay but per above there are two issues 'editable' and the output for 'selected' which is broken. I can add the 'editable' artificially in the label to avoid the second issue. That would make the screen reader output alert the user, but the internal accessibility tree would consider the element not 'editable' I think that should be okay I can't think of an operational problem with the above. you okay with that approach? |
of course on updating to current master something is changed ... have to figure out another quirk first |
I read your answer again, I guess I don't follow what 'selected' means or why it's related to whether the control is editable.
This is what I'm nervous about, I don't know whether adding it to the label manually will produce the same experience, or if it will confuse some tools. |
I totally agree about dubious workarounds, that's why I was frustrated not finding a definitive , documented solution to this. to reiterate the issue more clearly: If a input has aria-readonly=false OR there is no added attribute, the control is 'editable' and that word is read after the label. The reader also reads the input selection which in my example should be 'selected 1000' The problem is if we use aria-readonly= false we get that error, with some recent change now the read-only seems to be ignored and we get the editable and erroneous selected text reader output. I will keep experimenting, but isn't there an accessibility team we can ask? |
We just switched back to Electron 2. I wonder if that's responsible for the new change you see. I'll ask around but I don't know of any experts nearby. |
I think you might be correct I was aware of the electron 2 just not exactly when it happened Currently I have come up with two choices: Read '1000 selected' with no precursor label e.g. File Auto Save SecondChoice we could add units and current setting and modified BUT ONLY as a suffix If you have a preference for one of the above two let me know I figure I converge in one of the two |
Yeah, that is annoying. I guess the second is preferable. |
well now that I knew what I'm looking for I found #5544 I will implement option two above until we have a better approach. |
Oh wow, that issue predates me. Good find. I am using the tree control here, but it does not currently really function as a "tree". I could transition away from the tree in the future, but if simply hacking the |
I also just found something related within the NVDA issues, not exactly our problem but related I think you would have a lot of rework if not using a tree , the role issue gets us something |
I don't think input elements are really supported inside a tree. ARIA grid specifically do, but some of the output appears different. I'm going to try a nested grid. |
The select box elements utilized within the new settings do not get their titles read
while the options appear to be read correctly. This behavior is different from
selected boxes contained within an action bar or individually rendered.
@roblourens
I am pretty sure this has to do with nested elements within a tree or the dynamic way the page is rendered. I'm trying to figure out how to test that.
I am researching changes made to ARIA 1.1 with many roles.
https://www.levelaccess.com/differences-aria-1-0-1-1-changes-rolecombobox/
The text was updated successfully, but these errors were encountered: