- Notifications
You must be signed in to change notification settings - Fork 82
[Accessibility] Fix SfTextInputLayout HelperText and ErrorText not visible to screen readers #215
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: main
Are you sure you want to change the base?
Conversation
Co-authored-by: PaulAndersonS <42271912+PaulAndersonS@users.noreply.github.com>
@copilot The source code draws the helper and error text natively instead of using semantic-friendly elements like Label, which causes screen readers to interpret the content incorrectly. To ensure proper semantic flow and focus order (entry field first, followed by helper or error text), I recommend modify the drawing of helper and error text in to MAUI Label controls and add the text respectively. The Entry will focus first and then the helper or error label will focus from accessibility. So generate the codes and share me |
…text Co-authored-by: PaulAndersonS <42271912+PaulAndersonS@users.noreply.github.com>
I've implemented the accessibility fix using MAUI Label controls as you requested. The changes replace canvas drawing with proper semantic elements, ensuring correct focus order. Key changes in commit af4bc46:
The Label controls provide native accessibility support and proper semantic structure, fixing the focus order issue where assistive text was receiving focus before the main input control. |
@copilot You're working on a .NET MAUI application using the TextInputLayout control, where accessibility behavior differs across platforms. A recent fix added Helper and Error text as Labels to improve screen reader focus. On Windows, this works as expected—Helper/Error labels get focus properly with screen readers like Narrator. However, on Android, the entire TextInputLayout control fails to receive focus when TalkBack is active. |
… helper/error labels Co-authored-by: PaulAndersonS <42271912+PaulAndersonS@users.noreply.github.com>
I've implemented an Android-specific fix for the TalkBack accessibility issue in commit 5fa0d5a. The problem was that adding Label controls as children to the SfView was interfering with Android's accessibility focus order. Key changes:
The fix ensures that on Android with TalkBack:
This maintains full backward compatibility while restoring proper Android TalkBack functionality alongside the existing Windows accessibility improvements. |
Screen readers like VoiceOver (macOS) and Narrator (Windows) were unable to access HelperText and ErrorText in SfTextInputLayout because they were drawn directly on canvas without semantic information.
Root Cause
The
GetSemanticsNodesCore()
method only created semantic nodes for numeric controls but ignored the assistive text elements that are rendered viacanvas.DrawText()
.Solution
Added semantic nodes for HelperText and ErrorText with proper positioning and accessibility labels:
Key Features
_helperTextRect
and_errorTextRect
fieldsTesting
Added comprehensive unit tests covering:
Example
Before this fix, screen readers could only access the Entry field. Now they can navigate to and read both helper text and error text, providing complete accessibility for users with visual impairments.
Fixes #181.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.