mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 13:06:00 +03:00
[PR #585] [MERGED] feat: Add focusable option to Box #1419
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#1419
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/585
Author: @eitanalka
Created: 1/25/2026
Status: ✅ Merged
Merged: 1/26/2026
Merged by: @kommander
Base:
main← Head:feat/box-focusable📝 Commits (5)
b79454cfeat(core): add focusable option to Box8b7faf5Merge branch 'anomalyco:main' into feat/box-focusablee9158e2prettier34493d5Merge branch 'main' into feat/box-focusableea12e68Merge branch 'main' into feat/box-focusable📊 Changes
7 files changed (+131 additions, -2 deletions)
View changed files
📝
packages/core/src/Renderable.ts(+4 -0)📝
packages/core/src/renderables/Box.test.ts(+27 -0)📝
packages/core/src/renderables/Box.ts(+5 -0)📝
packages/react/src/types/components.ts(+3 -1)📝
packages/react/tests/layout.test.tsx(+45 -0)📝
packages/solid/src/types/elements.ts(+3 -1)➕
packages/solid/tests/box.test.tsx(+44 -0)📄 Description
Issue
Summary
Add a
focusableoption to Box so it can be made focusable (default false). This enables the existingfocusedBorderColorfeature to actually work.Motivation
Currently, Box has a
focusedBorderColoroption but Box cannot be focused, making this option useless. Addingfocusableallows users to opt-in to focus behavior.Proposed Changes
focusablesetter toRenderablefor dynamic prop updatesfocusableoption toBoxOptions(default false)focusedprop toBoxProps(React/Solid) for controlled focus stateUsage
Behavior
new Box({})new Box({ focusable: true })new Box({ focusable: true, focusedBorderColor: "blue" })<Box focusable /><Box focusable focused={signal()} />🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.