From 5a6b0843480e46e4a5835f3e84f38eb96563363e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Sat, 21 Mar 2026 18:48:35 +0100 Subject: [PATCH] nicolium: fix 'exploding buttons #81', finally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- packages/nicolium/src/components/accounts/account.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/nicolium/src/components/accounts/account.tsx b/packages/nicolium/src/components/accounts/account.tsx index eb0721de8..d0ea822c9 100644 --- a/packages/nicolium/src/components/accounts/account.tsx +++ b/packages/nicolium/src/components/accounts/account.tsx @@ -207,15 +207,17 @@ const Account = ({ useLayoutEffect(() => { const onResize = () => { + console.log('resizing'); const style: React.CSSProperties = {}; const actionWidth = actionRef.current?.clientWidth ?? 0; if (overflowRef.current) { + const maxWidth = overflowRef.current.classList.contains('w-fit') + ? overflowRef.current.parentElement!.clientWidth + : overflowRef.current.clientWidth; style.maxWidth = Math.max( 0, - overflowRef.current.clientWidth - - (withAvatar ? avatarSize + 12 : 0) - - (actionWidth ? actionWidth + 12 : 0), + maxWidth - (withAvatar ? avatarSize + 12 : 0) - (actionWidth ? actionWidth + 12 : 0), ); } @@ -344,9 +346,8 @@ const Account = ({ className={clsx('⁂-account-card', { '⁂-account-card--action-top': actionAlignment === 'top', })} - ref={overflowRef} > -
+