Skip to content

Commit 8e64fb8

Browse files
author
Patryk Śliwiński
committed
fix: Fix wrong height on toast update
1 parent 45d8940 commit 8e64fb8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,15 @@ const Toast = (props: ToastProps) => {
167167
if (!mounted) return;
168168
const toastNode = toastRef.current;
169169
const originalHeight = toastNode.style.height;
170+
const originalTransition = toastNode.style.transition;
171+
const originalTransform = toastNode.style.transform;
170172
toastNode.style.height = 'auto';
173+
toastNode.style.transition = 'none';
174+
toastNode.style.transform = 'none';
171175
const newHeight = toastNode.getBoundingClientRect().height;
172176
toastNode.style.height = originalHeight;
177+
toastNode.style.transform = originalTransform;
178+
toastNode.style.transition = originalTransition;
173179

174180
setInitialHeight(newHeight);
175181

0 commit comments

Comments
 (0)