diff --git a/libs/ngx-sonner/src/lib/toast.component.ts b/libs/ngx-sonner/src/lib/toast.component.ts index ad6a0df..7c470da 100644 --- a/libs/ngx-sonner/src/lib/toast.component.ts +++ b/libs/ngx-sonner/src/lib/toast.component.ts @@ -230,6 +230,7 @@ export class ToastComponent implements AfterViewInit, OnDestroy { isVisible = computed(() => this.index() + 1 <= this.visibleToasts()); toastType = computed(() => this.toast().type ?? 'default'); toastClass = computed(() => this.toast().class ?? ''); + toastPosition = computed(() => this.toast().position ?? this.position()); toastDescriptionClass = computed(() => this.toast().descriptionClass ?? ''); heightIndex = computed(() => @@ -242,7 +243,7 @@ export class ToastComponent implements AfterViewInit, OnDestroy { lastCloseTimerStartTimeRef = 0; pointerStartRef: { x: number; y: number } | null = null; - coords = computed(() => this.position().split('-')); + coords = computed(() => this.toastPosition().split('-')); toastsHeightBefore = computed(() => this.heights().reduce((prev, curr, reducerIndex) => { if (reducerIndex >= this.heightIndex()) return prev;