LearnNewsExamplesServices
Frontmatter
id8041
titleUpdate Flexbox layout to use correct flex shorthand for numbers
stateClosed
labels
enhancementjavascriptai
assigneestobiu
createdAtDec 6, 2025, 10:37 PM
updatedAtDec 6, 2025, 10:42 PM
githubUrlhttps://github.com/neomjs/neo/issues/8041
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 6, 2025, 10:42 PM

Update Flexbox layout to use correct flex shorthand for numbers

Closed v11.17.0 enhancementjavascriptai
tobiu
tobiu commented on Dec 6, 2025, 10:37 PM

Update src/layout/Flexbox.mjs to correctly handle numeric flex values. Currently, flex: 1 is converted to flex: '1 1 auto', which can cause layout inconsistencies (e.g. in AgentOS.view.Viewport). According to MDN, a unitless number should translate to flex: <number> 1 0%.

Change: If flex is a number, convert it to ${flex} 1 0%.

tobiu added the enhancement label on Dec 6, 2025, 10:37 PM
tobiu added the javascript label on Dec 6, 2025, 10:37 PM
tobiu added the ai label on Dec 6, 2025, 10:37 PM
tobiu assigned to @tobiu on Dec 6, 2025, 10:39 PM
tobiu referenced in commit 910770d - "Update Flexbox layout to use correct flex shorthand for numbers #8041" on Dec 6, 2025, 10:40 PM
tobiu
tobiu Dec 6, 2025, 10:42 PM

Input from Gemini 2.5 pro:

✦ Implemented the fix in src/layout/Flexbox.mjs. applyChildAttributes now checks if flex is a number using Neo.isNumber(flex) and converts it to ${flex} 1 0%. This prevents flex: 1 from being converted to flex: '1 1 auto', resolving layout issues where equal distribution was expected but content size interfered.

tobiu closed this issue on Dec 6, 2025, 10:42 PM