mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 04:55:58 +03:00
[PR #414] [MERGED] fix: reset flex properties on style removal #1297
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#1297
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/414
Author: @edlsh
Created: 12/13/2025
Status: ✅ Merged
Merged: 12/23/2025
Merged by: @kommander
Base:
main← Head:fix/flex-state-change-391📝 Commits (7)
1588e49fix: reset flex properties on style removal (#391)606a36crefactor(tests): simplify layout tests to use testRender helper22e0b81Merge branch 'main' into fix/flex-state-change-3913aa54b1Merge branch 'main' into fix/flex-state-change-391ececaa9Merge branch 'main' into fix/flex-state-change-39112852cfprettier4531450cleanup📊 Changes
5 files changed (+0 additions, -0 deletions)
View changed files
📝
packages/core/src/Renderable.ts(+7 -16)📝
packages/core/src/lib/yoga.options.test.ts(+55 -0)📝
packages/core/src/lib/yoga.options.ts(+28 -0)📝
packages/react/src/utils/index.ts(+16 -12)📝
packages/react/tests/layout.test.tsx(+98 -0)📄 Description
Fix flex state change bug
Fixes #391
Problem
When switching from
<box alignItems="center">to<box>via React state, alignment stuck at previous value instead of resetting to default.Root Causes
setStyledidn't reset removed style properties tonullparseAligndefaulted toAuto, notStretch(CSS spec foralign-items)Changes
yoga.options.ts: AddedparseAlignItems()defaulting toStretchRenderable.ts: Set flex properties unconditionally; useparseAlignItemsforalignItemsutils/index.ts: Reset removed style keys tonullinsetStyleReferences
Per MDN align-items:
Per W3C CSS Flexbox Level 1:
Per Yoga Layout Styling:
Verification
Tests added:
should use default alignItems when conditionally switching components with React stateshould correctly align text when box has no explicit alignItemsshould reset alignItems when style prop removes the property🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.