Implement UIAccessibilityContainer informal protocol and make error labels accessible#5
Open
sharplet wants to merge 9 commits intostephsharp:masterfrom
Open
Implement UIAccessibilityContainer informal protocol and make error labels accessible#5sharplet wants to merge 9 commits intostephsharp:masterfrom
sharplet wants to merge 9 commits intostephsharp:masterfrom
Conversation
The demo app target wasn't configured to embed MaterialTextField.framework into the app, so when running on device the framework couldn't be loaded and the app would crash.
For now the accessibility behaviour of the text field is identical to before. The text field is now a container, and its accessibilityElements include a single proxy element that just reports the accessibility properties of the text field itself.
From the `NSObject(UIAccessibilityContainer)` docs: > Containers can implement this property instead of the dynamic methods > to support the retrieval of the contained elements. The default value > of this property is nil. This doesn't seem to be entirely true. The behaviour observed was: - When navigating through MFTextFields, you could never sequentially navigate to the error label. - You could find the error by moving your finger around until it gained focus. - Once you'd located the error label this way, sequential navigation between accessibility elements was broken completely. Adding implementations of the dynamic methods resolved the issue.
Owner
|
Found the following issues with voice over:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here's a quick summary of the changes
MFTextFieldis now an accessibility container.UIAccessibilityContainerinformal protocol that an accessibility container can't itself be accessible, so how is this achieved? I've created a proxy element that decoratesMFTextFieldand just delegates all accessibility properties to it.)UIAccessibilityLayoutChangedNotification, with the error label as the argument, so the error label gains focus whenever it appears.Let me know if you have any questions! Seems to work ok using the demo app on my device.