fix(ToastPortal): prevent text overflow by adjusting toast width styles

This commit is contained in:
icarus 2025-10-12 04:13:32 +08:00
parent fd1a3faa69
commit 5776512bf6

View File

@ -23,7 +23,8 @@ export const ToastPortal = () => {
timeout: 3000,
classNames: {
// This setting causes the 'hero-toast' class to be applied twice to the toast element. This is weird and I don't know why, but it works.
base: 'hero-toast'
// `w-auto` would not overwrite default style, which set the width to a fixed value and causes text overflow.
base: 'hero-toast w-auto! max-w-[50vw]'
}
}}
/>,