Skip to content

ActionItems lacks proper support for VoiceOver on iOS #2796

Closed

Description

@m-abs

The text-property on ActionItems on the ActionBar isn't read by VoiceOver on iOS, only the icon name is and ActionItem doesn't have the property automationText. That's because ActionItem doesn't inherit from ui/core/view.

On iOS UIBarButtonItem is used to create the ActionItem, but UIBarButtonItem doesn't implement the UIAccessibility-protocol, but according to this stackoverflow http://stackoverflow.com/questions/23800764/ios-7-uibarbuttonitem-with-accessibility it should be possible it activate it anyways.

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • CLI: 2.3.0
  • Cross-platform modules: 2.3.0
  • Runtime(s): tns-ios 2.3.0

Please tell us how to recreate the issue in as much detail as possible.

  • Create an ActionBar with an ActionItem set a text-label on the ActionItem
  • Run the app on iOS with VoiceOver enabled
  • Listen to the text being read, it's the icon-name followed by "button"

Activity

  1. m-abs commented on Sep 26, 2016

    @m-abs
    ContributorAuthor

    Update:

    I think I see the problem:
    https://github.com/NativeScript/NativeScript/blob/2.3.0/tns-core-modules/ui/action-bar/action-bar.ios.ts#L134-L163

    If we have an icon on the ActionItem the text is never set on the UIBarButtonItem, so of cause iOS' VoiceOver can't read the text.

    I'm working on a PR that hopefully solves the problem.

  2. added a commit that references this issue on Sep 26, 2016
    ded170e
  3. vchimev commented on Sep 29, 2016

    @vchimev
    Contributor

    Hi @m-abs,

    Thank you for the pull request.

    Could you please send us a sample page which demonstrates the issue along with:

    • how does VoiceOver read it currently and
    • how is it expected to read it?

    In this way, we would be able to review your pull request properly.

    For example, my test page is as follow:

    <Page>
      <Page.actionBar>
        <ActionBar >
          <ActionBar.actionItems>
            <ActionItem text="Item" />
            <ActionItem>
              <ActionItem.actionView>
                <Button text="View" automationText="test" />
              </ActionItem.actionView>
            </ActionItem>
          </ActionBar.actionItems>
        </ActionBar>
      </Page.actionBar>
      <StackLayout>
        <Label text="This is a test."/>
      </StackLayout>
    </Page>
    

    It is read as follows: Item -> Button, Test -> Button

  4. m-abs commented on Oct 1, 2016

    @m-abs
    ContributorAuthor

    HI @vchimev,

    The problem is caused by adding an icon to the ActionItem, because the text-value was never added to the UINavigationButton.

    I've written a demo as requested, it's based on tns create APP_NAME --template typescript and I've tested with a local install of ´tns-core-moduleswith my patch and ontns-core-modules@next`

    The screenshots is from running on the iPhone emulator, so you can see the Accessibility Inspector:

    The ActionItem on https://github.com/m-abs/actionitem-demo/blob/master/app/main-page.xml#L5

    Here without my patch:
    screen shot 2016-10-01 at 17 19 28
    As you can see the inspector says the Label is X the filename of my icon.

    Expected reading order is "My ActionItem Text" -> "Button"
    As seen here with the patch:
    screen shot 2016-10-01 at 17 28 32

    If you were testing the ActionItem > Button on tns-core-modules@2.3.0, my other PR for automationText on iOS weren't a part of that release. (#2678) but it is on master, so it's in my current PR.

    Expected reading order "AutoText" > "Button"
    As seen here:
    screen shot 2016-10-01 at 17 31 50

    Note: that automationText doesn't exist on ActionItem because contentDescription doesn't exist on the MenuItem used on Android.

  5. vchimev commented on Oct 4, 2016

    @vchimev
    Contributor

    @m-abs, many thanks for the details.

  6. added a commit that references this issue on Oct 5, 2016
    37d927b
  7. added this to the 2.4.0 milestone on Oct 5, 2016
  8. lock commented on Aug 29, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  9. locked and limited conversation to collaborators on Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions