mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 13:06:00 +03:00
[GH-ISSUE #438] Bug: nested <text> elements not supported. #113
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#113
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?
Originally created by @dhleong on GitHub (Dec 22, 2025).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/438
Originally assigned to: @kommander on GitHub.
I would expect to be able to do something like this:
and have the
build?text show both dim and underlined, but instead I get an error that:Is there an expected way to compose text like this? The error message suggests this should work, though peeking in briefly it seems that the react module is using a
TextBufferRenderableand not aTextNodeRenderable....@msmps commented on GitHub (Dec 22, 2025):
This is expected 👍
or
@msmps commented on GitHub (Dec 22, 2025):
There are more examples here
@dhleong commented on GitHub (Dec 22, 2025):
I see, thanks! This design does make composition problematic: a component that returns a
<text>component may not be composed into another that wants to render that<text>inline, but a component that returns a<span>cannot itself be directly rendered—the caller must wrap it in a<text>(which, then, means the caller couldn't in turn be composed inside another<text>!).I'm curious about the purpose of this separation? Ink, for example, just has
<Text>which can both compose other Text elements and be rendered on its own.@kommander commented on GitHub (Dec 23, 2025):
That is due to how text rendering works with
StyledTextchunks. I want to refactor that to be closer to the actual text buffer rope segments/chunks, using highlights. Also theTextNode's which are currently the stylable children of Text should be just Text instances, which should support nesting, flattening to the outer most Text parent.It will be supported, I just didn't have the time to do that yet, as it's quite a large core change.
@lukeed commented on GitHub (Feb 2, 2026):
Having
<span>children can cover all the styling needs of nested texts, but there's currently no way to have mouse handlers for nested subtexts