FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: #2796 - ActionItems lacks proper support for VoiceOver on iOS (#… · NativeScript/NativeScript@37d927b · GitHub

Commit 37d927b

Browse files
authored andcommitted
fix: #2796 - ActionItems lacks proper support for VoiceOver on iOS (#2799)
UIBarButtonItem weren't created with a title/text so VoiceOver couldn't know what to reads. This marks the element as an AccessibilityElement and sets an accessibilityLabel.
1 parent 0d2d343 commit 37d927b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎tns-core-modules/ui/action-bar/action-bar.ios.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ export class ActionBar extends common.ActionBar {
159159
barButtonItem = UIBarButtonItem.alloc().initWithTitleStyleTargetAction(item.text + "", UIBarButtonItemStyle.Plain, tapHandler, "tap");
160160
}
161161

162+
if (item.text) {
163+
barButtonItem.isAccessibilityElement = true;
164+
barButtonItem.accessibilityLabel = item.text;
165+
barButtonItem.accessibilityTraits = UIAccessibilityTraitButton;
166+
}
167+
162168
return barButtonItem;
163169
}
164170

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL