Nativescript: Bug(iOS): Escape-gesture doesn't work as expected for VoiceOver users.

Created on 26 Jul 2018  路  4Comments  路  Source: NativeScript/NativeScript

Tell us about the problem

Accessibility users can't dismiss dialogs and go back with the z-gesture*.

*) Z-Gesture also known as the escape-gesture

Which platform(s) does your issue occur on?

iOS only.

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

  • CLI: 4.1.x, 4.0.x, 3,x etc.
  • Cross-platform modules: 4.1.0
  • Runtime(s): [email protected]
  • Plugin(s): none

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

The problem is in two parts, both requires VoiceOver to be enabled to demonstrate.

Dialogs

Any dialog created from tns-core-modules/ui/dialogs cannot be dismissed with the z/escape-gesture. NativeScript doesn't implement the accessibiliityPerformEscape()-function on UIAlertController.

Modal pages without a NavigationButton.

Create a new page and hide the NavigationButton. This disables the z-gesture for this page.

Our accessibility users expects the z-gesture working in both these cases.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

I've create a simple example here:
https://play.nativescript.org/?template=play-ng&id=vuchBL&v=10

You need to enable VoiceOver to see the problem.

  1. Start by tapping "Show Alert", this will create an alert.
    Try to dismiss it by drawing a Z on the screen with two fingers.
    The device will make a noise but nothing else will happen.
    Our accessibility users expects the alert to be dismissed and complains about it.

  2. Close the alert manually.

  3. Tap the "Show modal page without the NavigationButton"
    This page will not have the NavigationButton to the left but will have a "done"-button to the right. (This is a common design for settings pages in our app).
    Once again try to dismiss the page with the z-gesture.
    This won't work.

  4. Go back to the home component again.

  5. Now tap the last button: "Show modal page with the NavigationButton"
    This is the same page as before, but with the NavigationButton.
    Once again try to dismiss the page with the z-gesture.
    This time you end up on the previous page, as expected.

I've previous submitted #4349 but back when I didn't understand the cause and ended up closing the issue, because it looked like an error in our end.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

feature help wanted ios

All 4 comments

@m-abs marking this one as a feature request.

If you have an idea on how the above can be implemented, we would be more than happy to accept PRs (or you could share the ideas so the community can take a look and implement these gestures).

Note about This time you end up on the previous page, as expected.

  • It might be possible that the back is working as the default back navigation on iOS is swipe back which is very similar to the last part of the escape gestures

4349

This time you end up on the previous page, as expected.

Hi @NickIliev

I thought it would be easy to add the functionality to the dialogs, so I decided to start with that.

Branch is here:
https://github.com/m-abs/NativeScript/tree/feature/escape-gesture

https://github.com/m-abs/NativeScript/blob/b2522dcc5e5f2aa5458632bf6c5f876fcc4d97a3/tns-core-modules/ui/dialogs/dialogs.ios.ts#L42-L73

Unfortunately the accessibilityPerformEscape() is never called as I expect when I make the escape-gesture.
What makes it confusing is that accessibilityPerformMagicTap() is called when I make the magic tap (two finger double tap).

Any ideas what I could be doing wrong?

I've tried adding the function to both UIViewControllerImpl in page.ios.ts and on UINavigationControllerImpl in frame.ios.ts

I could also use some feedback, here is my thoughts so far:

  • alert, dismissed with the escape-gesture.
  • confirm, cancelled with the escape-gesture, ok'ed with the magic-tap.
  • prompt, cancelled with the escape-gesture.
  • login, cancelled with the escape-gesture, ok'ed with the magic-tap.
  • action, cancelled with the escape-gesture.

If you have an idea on how the above can be implemented, we would be more than happy to accept PRs (or you could share the ideas so the community can take a look and implement these gestures).

One thing I'd really love here is an event similar to the androidBackPressed-event that can be cancelled.

I don't really understand why it doesn't work without the NavigationButton.

It might be possible that the back is working as the default back navigation on iOS is swipe back which is very similar to the last part of the escape gestures

I think that would be worth looking into.

Was this page helpful?
0 / 5 - 0 ratings