MaterialTextField icon indicating copy to clipboard operation
MaterialTextField copied to clipboard

Implement UIAccessibilityContainer informal protocol and make error labels accessible

Open sharplet opened this issue 9 years ago • 1 comments

Here's a quick summary of the changes

  • MFTextField is now an accessibility container.
  • The first accessible element is the underlying text field itself. (It's documented in the UIAccessibilityContainer informal protocol that an accessibility container can't itself be accessible, so how is this achieved? I've created a proxy element that decorates MFTextField and just delegates all accessibility properties to it.)
  • The second accessibility element is the error label. It's dynamically added and removed whenever the error label itself appears on screen. In addition, when the error label appears, I'm posting a 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.

sharplet avatar Jan 07 '16 03:01 sharplet

Found the following issues with voice over:

  • Cannot swipe up/down to move insertion point when editing text field
  • Cannot tap clear text button (black rectangle does not include the clear button like it does for UITextField)

stephsharp avatar Jan 11 '16 03:01 stephsharp