mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 13:06:00 +03:00
[PR #249] [MERGED] fix(solid): init border when supporting props are present #396
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#396
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/249
Author: @msmps
Created: 11/1/2025
Status: ✅ Merged
Merged: 11/1/2025
Merged by: @kommander
Base:
main← Head:fix/solid-border-20251101122249📝 Commits (1)
9b180ccfix(solid): init border when supporting props are present📊 Changes
3 files changed (+108 additions, -2 deletions)
View changed files
📝
packages/core/src/renderables/Box.ts(+17 -2)📝
packages/solid/tests/__snapshots__/layout.test.tsx.snap(+37 -0)📝
packages/solid/tests/layout.test.tsx(+54 -0)📄 Description
Fix: Auto-enable border when border props are set in Solid
Fixes #186
Problem
In Solid, setting
borderStyle,borderColor, orfocusedBorderColoron<box>elements doesn't display borders unlessborderis explicitly set totrue. This behavior differs from React, where borders appear automatically.Root Cause
The Box constructor has logic to auto-enable borders when border-related props are provided. However:
{ id }during construction, sets props via setters afterwards ❌createElementdoesn't have access to propsSolution
Extracted border initialization logic into a private
initializeBorder()method and call it from the property setters for:borderStyleborderColorfocusedBorderColorThis ensures borders are auto-enabled regardless of when/how props are set.
Testing
Added test cases in
packages/solid/tests/layout.test.tsxverifying borders auto-enable for all border-related props.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.