mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #921] Grid minimum dimensions are sometimes not respected #670
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#670
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 @bow on GitHub (Nov 23, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/921
I am encountering a problem with how grids handle different screen sizes. When grids contain other containers (e.g. other grids or flex containers), it seems to respond to the screen size only intermittently. That is, sometimes it shows the correct items, sometimes it show items meant for other sizes.
My starting point is the
griddemo. I can run that perfectly fine; the visible items do change based on my terminal size. I am running on Linux, using Alacritty version 0.12.3.The problem then showed up when running the following code:
The problem showed up when running the code in a terminal wider than 150 columns (the
minGridWidthvalue set above):Wideboxes) are rendered.h) multiple times. Sometimes the narrow layout will be shown instead.There is also another case, that is when resizing from a smaller terminal to a larger one. This, too, sometimes results in the narrow layout being rendered.
I could not reproduce these two problems with the
demos/grid/main.gofile. There, all the components are always rendered correctly. This lead me to think that it is the flex containers being nested inside a grid that is the problem (the demo file nests non-containers instead). However, I am not sure if this is it nor how to fix / work around this.Any pointers and / or suggestions?
(P.S. Thanks for developing
tviewby the way!)@WhipMeHarder commented on GitHub (Nov 23, 2023):
My apologies to you, Box, for interjecting in your issue problems as defined here, as I am also encountering problems with the grid control. I am having the same/similar problems with grid control items not maintaining their dimension size integrity. Especially, when the grid has a column of 3 x 4 boxes placed with it. It does not seem to matter what dimension variations are placed within it, the grid control seems to be limited to having only 9 boxes placed within it. - Even then, there are "severe" size limitations to the box dimensions, otherwise everything becomes unstable. More importantly, the boxes then can only be set at a size where they are not practical to be used.
I have tested your code in Windows 10. My terminal has 237 columns, as seen here:
`Status for device CON:
Everything displays correctly.
@rivo commented on GitHub (Nov 26, 2023):
@bow Indeed, the
Gridcomponent did not resolve overlapping grid items correctly. This should be fixed with the latest commit.@WhipMeHarder If your problem persists after this bugfix, please open a separate issue, along with demo code to reproduce it.
@bow commented on GitHub (Nov 26, 2023):
Thanks a lot @rivo. I can confirm the problem does not occur anymore with that commit.