From 25479e4ad8461a8a788a4bdcff3ed32955e6cadc Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Mon, 27 Aug 2018 21:52:56 +0200 Subject: [PATCH] fix(toast): add position middle --- core/src/components/toast/toast-interface.ts | 2 +- core/src/components/toast/toast.tsx | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/src/components/toast/toast-interface.ts b/core/src/components/toast/toast-interface.ts index 377fac5d53..91fa3b5b9f 100644 --- a/core/src/components/toast/toast-interface.ts +++ b/core/src/components/toast/toast-interface.ts @@ -6,7 +6,7 @@ export interface ToastOptions { duration?: number; showCloseButton?: boolean; closeButtonText?: string; - position?: 'top' | 'bottom'; + position?: 'top' | 'bottom' | 'middle'; translucent?: boolean; enterAnimation?: AnimationBuilder; leaveAnimation?: AnimationBuilder; diff --git a/core/src/components/toast/toast.tsx b/core/src/components/toast/toast.tsx index 5459dd68ef..8715979dc2 100644 --- a/core/src/components/toast/toast.tsx +++ b/core/src/components/toast/toast.tsx @@ -71,7 +71,7 @@ export class Toast implements OverlayInterface { /** * The position of the toast on the screen. Possible values: "top", "middle", "bottom". */ - @Prop() position?: 'top' | 'bottom'; + @Prop() position: 'top' | 'bottom' | 'middle' = 'bottom'; /** * If true, the close button will be displayed. Defaults to `false`. @@ -190,10 +190,9 @@ export class Toast implements OverlayInterface { } render() { - const position = this.position ? this.position : 'bottom'; const wrapperClass = { 'toast-wrapper': true, - [`toast-${position}`]: true + [`toast-${this.position}`]: true }; return (