Skip to content

Commit 313a963

Browse files
fix(web): hide stash menu when the composer has no width
1 parent 5047ee7 commit 313a963

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎apps/web/src/components/chat/ChatComposer.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,11 @@ function ComposerCommandMenuLayer(props: { anchor: HTMLElement | null; children:
10171017
window.getComputedStyle(form ?? anchor).getPropertyValue("--chat-composer-drawer-inset"),
10181018
);
10191019
const drawerInset = drawerInsetRem * rootFontSizePx;
1020+
const width = rect.width - drawerInset * 2;
1021+
if (width <= 0) {
1022+
setPosition(null);
1023+
return;
1024+
}
10201025
// One extra pixel prevents fractional layout coordinates from exposing
10211026
// the canvas between the drawer mask and the composer's foreground edge.
10221027
// Mirrors --chat-composer-attachment-overlap: calc(1rem + 1px).
@@ -1025,7 +1030,7 @@ function ComposerCommandMenuLayer(props: { anchor: HTMLElement | null; children:
10251030
bottom: window.innerHeight - rect.top - composerOverlap,
10261031
left: rect.left + drawerInset,
10271032
maxHeight: Math.max(96, rect.top - 24 + composerOverlap),
1028-
width: Math.max(0, rect.width - drawerInset * 2),
1033+
width,
10291034
};
10301035
setPosition((current) =>
10311036
current && composerCommandMenuPositionsEqual(current, next) ? current : next,

0 commit comments

Comments
 (0)