You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] TopNav: the heading's wrapper never shrinks, so a long heading runs out of its column #9530
TopNav wraps heading in a div that never shrinks (styles.heading, flexShrink: 0, TopNav.tsx#L66-L70, rendered at #L294). The section that holds it does shrink (leftSection: flex: 1 1 0%, minWidth: 0), so when the heading is wider than its share of the bar it overflows the section instead of narrowing.
With centerContent the bar is a 1fr auto 1fr grid, so the start column is fixed. A long heading, such as a workspace name, then runs out of its column and under the centre content. A TopNavHeading whose text truncates never gets its ellipsis, because nothing narrows it. Without centerContent the same heading runs under endContent.
Expected: the heading wrapper shrinks with its section (flexShrink: 1, minWidth: 0), so a heading that can truncate does so inside its column, and the centre content keeps its place.
Reproduction
import{TopNav,TopNavHeading,TopNavItem}from'@astryxdesign/core';exportfunctionRepro(){return(<divstyle={{width: 1280}}><TopNavlabel="Main"heading={<TopNavHeadingheading="Công ty Cổ phần Giải pháp Nhân sự Hải Đăng Việt Nam"/>}centerContent={<inputaria-label="Search"style={{width: 560}}/>}endContent={<buttontype="button">Account</button>}><TopNavItemlabel="Jobs"href="/jobs"/></TopNav></div>);}
Render it 1280px wide. The grid gives the start column 352px.
The heading's wrapper is 448px wide: it runs past its column and under the search field, and the name shows no ellipsis.
In jsdom, the wrapper of the heading (the first child of the bar's first section) carries the class whose rule is flex-shrink: 0.
Any browser. The 1280px widths are from an app's Chromium capture at 1280×800; the wrapper's flex-shrink: 0 was read in jsdom (Vitest, Testing Library).
Activity
fix(TopNav): let the heading shrink so a long heading truncates insid…