diff --git a/libs/ngx-sonner/src/lib/state.ts b/libs/ngx-sonner/src/lib/state.ts index 5c9c08a..6b6661c 100644 --- a/libs/ngx-sonner/src/lib/state.ts +++ b/libs/ngx-sonner/src/lib/state.ts @@ -31,7 +31,7 @@ function createToastState() { ? data.id : toastsCounter++; - const dismissable = data.dismissable ?? true; + const dismissible = data.dismissible ?? true; const type = data.type ?? 'default'; const alreadyExists = toasts().find(toast => toast.id === id); @@ -45,7 +45,7 @@ function createToastState() { ...data, id, title: message, - dismissable, + dismissible, type, updated: true, }; @@ -53,7 +53,7 @@ function createToastState() { }) ); } else { - addToast({ ...rest, id, title: message, dismissable, type }); + addToast({ ...rest, id, title: message, dismissible: dismissible, type }); } return id; diff --git a/libs/ngx-sonner/src/lib/toast.component.ts b/libs/ngx-sonner/src/lib/toast.component.ts index b1df67b..101a6b0 100644 --- a/libs/ngx-sonner/src/lib/toast.component.ts +++ b/libs/ngx-sonner/src/lib/toast.component.ts @@ -70,6 +70,7 @@ const defaultClasses: ToastClassnames = { [attr.data-index]="index()" [attr.data-front]="isFront()" [attr.data-swiping]="swiping()" + [attr.data-dismissible]="toast().dismissible" [attr.data-type]="toastType()" [attr.data-invert]="invert()" [attr.data-swipe-out]="swipeOut()" @@ -78,7 +79,7 @@ const defaultClasses: ToastClassnames = { (pointerdown)="onPointerDown($event)" (pointerup)="onPointerUp()" (pointermove)="onPointerMove($event)"> - @if (toast().dismissable && closeButton() && !toast().component) { + @if (toast().dismissible && closeButton() && !toast().component) {