mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #831] Setting a border on a Flex will hide the children. #605
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#605
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 @tcurdt on GitHub (Mar 26, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/831
I am not sure what I am missing here - but as soon as I set a border the children disappear.
The same happens when setting a padding.
Without it looks like this:
@tcurdt commented on GitHub (Mar 26, 2023):
Interesting. This seems to be related to the builder pattern.
This works:
@tcurdt commented on GitHub (Mar 26, 2023):
Unfortunately setting a padding reveals an area where I cannot set a background color.
Here the left and right padding is just white instead of black.
@andreas-habel commented on GitHub (Apr 5, 2023):
I have the same issue here with a list:
@kiyutink commented on GitHub (Apr 5, 2023):
Hey folks,
.SetBorderreturns a*tview.Boxfor any primitive, because.Borderis a method that comes from embedding a*Boxinto all the other primitives (see example for list).What's happening is that by calling
.Borderat the end, the returned value captured in the variable is not a list, but a box. I imagine using this approach is the best bet hereWith list that would mean instead of this:
Do this:
@tcurdt commented on GitHub (Apr 5, 2023):
The work around is clear.
But I think the point is that the API suggest the use of a builder pattern - and that has issues.
@rivo commented on GitHub (Apr 6, 2023):
@tcurdt True. See also https://github.com/rivo/tview/issues/141#issuecomment-410437784 for some context.
@rivo commented on GitHub (Apr 6, 2023):
The latest commit clarifies this in the package documentation. It should appear here once that page is updated. Unfortunately, there's no good way to implement this in Go without duplicating a lot of code.
@tcurdt commented on GitHub (Apr 6, 2023):
I might just drop using the builder all together.
Thanks for clarifying this in the docs.
For this https://github.com/rivo/tview/issues/831#issuecomment-1484148541 I should probably open another issue.