diff --git a/src/components/ToastContainer.tsx b/src/components/ToastContainer.tsx index 9efbbc04..92c10a19 100644 --- a/src/components/ToastContainer.tsx +++ b/src/components/ToastContainer.tsx @@ -53,8 +53,10 @@ export function ToastContainer(props: ToastContainerProps) { } function collapseAll() { - setIsCollapsed(true); - toast.play(); + if (stacked) { + setIsCollapsed(true); + toast.play(); + } } useLayoutEffect(() => { @@ -94,8 +96,10 @@ export function ToastContainer(props: ToastContainerProps) { className={Default.CSS_NAMESPACE as string} id={containerId as string} onMouseEnter={() => { - setIsCollapsed(false); - toast.pause(); + if (stacked) { + setIsCollapsed(false); + toast.pause(); + } }} onMouseLeave={collapseAll} > diff --git a/src/hooks/useToast.ts b/src/hooks/useToast.ts index b06b58ef..db22c332 100644 --- a/src/hooks/useToast.ts +++ b/src/hooks/useToast.ts @@ -167,7 +167,7 @@ export function useToast(props: ToastProps) { eventHandlers.onMouseEnter = pauseToast; // progress control is delegated to the container - if (props.stacked === false) eventHandlers.onMouseLeave = playToast; + if (!props.stacked) eventHandlers.onMouseLeave = playToast; } // prevent toast from closing when user drags the toast