Skip to content

Toast :: No way to block UI interaction since beta9 #7020

@awe-sim

Description

@awe-sim

Toast component no longer has the option to prevent UI interaction as "enableBackdropDismiss" option has been completely removed.

I was suggested by @jgw96 in this thread about an Alerts issue that a better UX would be to show a Toast on top of the first Alert. But since the Toast can no longer block UI interaction, it fails to achieve the objective in my case.

Short description of the problem:

  1. An Alert with an input and two buttons 'OK' and 'Cancel' (with role 'cancel') are shown.
  2. User enters an invalid value and taps 'OK', triggering the OK handler.
  3. The handler detects invalid input and shows a Toast informing the user of the input problem (earlier, I was showing a second Alert on top of the first one).
  4. The user accidentally taps on the page background, thinking that the Toast will be dismissed.
  5. Instead, this causes the CANCEL handler for Alert to be triggered, dismissing the dialog, but leaving the Toast. If the Toast is not configured with duration or showCloseButton, there is no way for the user to close the Toast now.

What behavior are you expecting?

  1. The user accidentally taps on the page background, thinking that the Toast will be dismissed.
  2. The Toast should be dismissed, firing it onDismiss handler which allow the user to interact with the Alert dialog, correct her mistake and continue on.

Way forward

I will have to wait for the Alerts issue to be resolved as I cannot use Toasts in this setting. I understand that the enableBackdropDismiss option was removed due to Material Design Specs, but it could've been done like so:

  • showBackdrop (boolean, default false) // shows backdrop, blocking UI interaction
  • enableBackdropDismiss (boolean, default true) // if backdrop is showing, closes Toast when background is tapped.

Steps to reproduce:
Already listed above.

Which Ionic Version?
2.0.0-beta-9

Run ionic info from terminal/cmd prompt:
Cordova CLI: 6.1.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.9-201606221959
Ionic CLI Version: 2.0.0-beta.31
Ionic App Lib Version: 2.0.0-beta.17
ios-deploy version: Not installed
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v4.4.2
Xcode version: Xcode 7.3.1 Build version 7D1014

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions