mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 13:32:54 +08:00
fix(toast): remove the enableBackdropDismiss option on toast
references #6291
This commit is contained in:
@ -23,9 +23,7 @@ class E2EPage {
|
|||||||
|
|
||||||
showToast() {
|
showToast() {
|
||||||
const toast = Toast.create({
|
const toast = Toast.create({
|
||||||
message: 'User was created successfully',
|
message: 'User was created successfully'
|
||||||
showCloseButton: true,
|
|
||||||
enableBackdropDismiss: false
|
|
||||||
});
|
});
|
||||||
|
|
||||||
toast.onDismiss(() => {
|
toast.onDismiss(() => {
|
||||||
@ -37,11 +35,16 @@ class E2EPage {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.nav.push(AnotherPage);
|
this.nav.push(AnotherPage);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
toast.dismiss();
|
||||||
|
}, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
showLongToast() {
|
showLongToast() {
|
||||||
const toast = Toast.create({
|
const toast = Toast.create({
|
||||||
message: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ea voluptatibus quibusdam eum nihil optio, ullam accusamus magni, nobis suscipit reprehenderit, sequi quam amet impedit. Accusamus dolorem voluptates laborum dolor obcaecati.',
|
message: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ea voluptatibus quibusdam eum nihil optio, ullam accusamus magni, nobis suscipit reprehenderit, sequi quam amet impedit. Accusamus dolorem voluptates laborum dolor obcaecati.',
|
||||||
|
duration: 5000
|
||||||
});
|
});
|
||||||
|
|
||||||
toast.onDismiss(this.dismissHandler);
|
toast.onDismiss(this.dismissHandler);
|
||||||
|
@ -62,7 +62,6 @@ import {ViewController} from '../nav/view-controller';
|
|||||||
export class Toast extends ViewController {
|
export class Toast extends ViewController {
|
||||||
|
|
||||||
constructor(opts: ToastOptions = {}) {
|
constructor(opts: ToastOptions = {}) {
|
||||||
opts.enableBackdropDismiss = isPresent(opts.enableBackdropDismiss) ? !!opts.enableBackdropDismiss : true;
|
|
||||||
opts.dismissOnPageChange = isPresent(opts.dismissOnPageChange) ? !!opts.dismissOnPageChange : false;
|
opts.dismissOnPageChange = isPresent(opts.dismissOnPageChange) ? !!opts.dismissOnPageChange : false;
|
||||||
|
|
||||||
super(ToastCmp, opts);
|
super(ToastCmp, opts);
|
||||||
@ -104,7 +103,6 @@ export class Toast extends ViewController {
|
|||||||
* | cssClass | `string` | - | Any additional class for custom styles. |
|
* | cssClass | `string` | - | Any additional class for custom styles. |
|
||||||
* | showCloseButton | `boolean` | false | Whether or not to show a button to close the toast. |
|
* | showCloseButton | `boolean` | false | Whether or not to show a button to close the toast. |
|
||||||
* | closeButtonText | `string` | "Close" | Text to display in the close button. |
|
* | closeButtonText | `string` | "Close" | Text to display in the close button. |
|
||||||
* | enableBackdropDismiss | `boolean` | true | Whether the toast should be dismissed by tapping the backdrop. |
|
|
||||||
* | dismissOnPageChange | `boolean` | false | Whether to dismiss the toast when navigating to a new page. |
|
* | dismissOnPageChange | `boolean` | false | Whether to dismiss the toast when navigating to a new page. |
|
||||||
*
|
*
|
||||||
* @param {object} opts Toast options. See the above table for available options.
|
* @param {object} opts Toast options. See the above table for available options.
|
||||||
@ -213,7 +211,6 @@ export interface ToastOptions {
|
|||||||
duration?: number;
|
duration?: number;
|
||||||
showCloseButton?: boolean;
|
showCloseButton?: boolean;
|
||||||
closeButtonText?: string;
|
closeButtonText?: string;
|
||||||
enableBackdropDismiss?: boolean;
|
|
||||||
dismissOnPageChange?: boolean;
|
dismissOnPageChange?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user