You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a simple ViewModel instead of a ButtonViewModel, we don't see any of the buttons being described as "button", because the view model is bound to plain views. One way to fix this is to force the accessibility role or trait.
On iOS, you simply add the UIAccessibilityTraitButton trait to the accessibilityTraits value: view.accessibilityTraits |= .button
On Android, it's a bit more complicated, you have to use an accessibilityDelegate to force the class name, or override view.onInitializeAccessibilityNodeInfo
When using a simple ViewModel instead of a ButtonViewModel, we don't see any of the buttons being described as "button", because the view model is bound to plain views. One way to fix this is to force the accessibility role or trait.
On iOS, you simply add the
UIAccessibilityTraitButton
trait to the accessibilityTraits value:view.accessibilityTraits |= .button
On Android, it's a bit more complicated, you have to use an
accessibilityDelegate
to force the class name, or overrideview.onInitializeAccessibilityNodeInfo
This wouldn't be necessary it the button view model were attached to actual button views.
Thanks @dominiclabbe for the proposition!
The text was updated successfully, but these errors were encountered: