Skip to content

Commit

Permalink
fix(toast): unexpected toast animation (#5003)
Browse files Browse the repository at this point in the history
* fix(deps): use RA beta toast

* chore(toast): remove non-existing wrapUpdate

* chore(changeset): add changeset
  • Loading branch information
wingkwong authored Mar 8, 2025
1 parent 41084ac commit 1f95899
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 29 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-doors-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@heroui/toast": patch
---

tmp fix for unexpected toast animation
4 changes: 2 additions & 2 deletions packages/components/toast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
"@heroui/shared-icons": "workspace:*",
"@heroui/use-is-mobile": "workspace:*",
"@heroui/spinner": "workspace:*",
"@react-aria/toast": "3.0.0",
"@react-aria/toast": "3.0.0-beta.19",
"@react-aria/utils": "3.28.0",
"@react-aria/interactions": "3.24.0",
"@react-stately/toast": "3.0.0",
"@react-stately/toast": "3.0.0-beta.7",
"@react-stately/utils": "3.10.5"
},
"devDependencies": {
Expand Down
12 changes: 0 additions & 12 deletions packages/components/toast/src/toast-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {flushSync} from "react-dom";
import {ToastOptions, ToastQueue, useToastQueue} from "@react-stately/toast";
import {useProviderContext} from "@heroui/system";

Expand All @@ -20,17 +19,6 @@ export const getToastQueue = () => {
if (!globalToastQueue) {
globalToastQueue = new ToastQueue({
maxVisibleToasts: Infinity,
wrapUpdate: (fn: () => void): void => {
if ("startViewTransition" in document) {
document
.startViewTransition(() => {
flushSync(fn);
})
.ready.catch(() => {});
} else {
fn();
}
},
});
}

Expand Down
30 changes: 15 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1f95899

Please sign in to comment.