Skip to content

Commit 5672463

Browse files
committed
fix(composer): prevent Aa toggle clipping during layout animation
Remove overflow-hidden from the toolbar's layout-animated container. The overflow clip (added in 50f951c to fix exit ghosting) was hiding the Aa toggle during intermediate layout frames — when popLayout pops the exiting group out of flow the container briefly shrinks, and overflow-hidden clips the layoutId-animated toggle mid-reposition. Also add layout="position" to the Aa wrapper so Framer Motion only animates its position, not size, avoiding measurement conflicts with the simultaneously-resizing parent. Exit animations (opacity → 0) still look correct without the clip since the fading elements are the intended visual.
1 parent 1ba0dd2 commit 5672463

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎desktop/src/features/messages/ui/MessageComposerToolbar.tsx‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,22 @@ export const MessageComposerToolbar = React.memo(
5959
return (
6060
<div className="mt-4 flex flex-wrap items-center justify-between gap-3">
6161
<LayoutGroup>
62-
<motion.div layout transition={layoutSpring} className="overflow-hidden py-1 flex items-center gap-1 min-h-11">
62+
<motion.div
63+
layout
64+
transition={layoutSpring}
65+
className="py-1 flex items-center gap-1 min-h-11"
66+
>
6367
{/*
6468
* Aa toggle — always rendered, uses layoutId to animate
6569
* smoothly between its passive (right) and expanded (left)
6670
* positions. Sits outside AnimatePresence so it never
6771
* unmounts — only repositions via layout animation.
6872
*/}
69-
<motion.div layoutId="aa-toggle" transition={layoutSpring}>
73+
<motion.div
74+
layout="position"
75+
layoutId="aa-toggle"
76+
transition={layoutSpring}
77+
>
7078
<Toggle
7179
aria-label="Toggle formatting"
7280
disabled={composerDisabled}

0 commit comments

Comments
 (0)