Skip to content

Commit

Permalink
Merge pull request #26 from tutkli/fix/position
Browse files Browse the repository at this point in the history
fix: prioritize toast position over toaster's
  • Loading branch information
tutkli authored Aug 23, 2024
2 parents 453a9fe + 874f47d commit 77c5cb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/ngx-sonner/src/lib/toast.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,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(() =>
Expand All @@ -240,7 +241,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;
Expand Down

0 comments on commit 77c5cb6

Please sign in to comment.