fix(toast): add position middle

This commit is contained in:
Manu Mtz.-Almeida
2018-08-27 21:52:56 +02:00
parent 1f71f76582
commit 25479e4ad8
2 changed files with 3 additions and 4 deletions

View File

@ -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;

View File

@ -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 (
<div class={wrapperClass}>