Closed darylhjd closed 6 months ago
Posting example code to reproduce the issue was really helpful to find the issue. Thank you for that.
As for this PR, it seems that you didn't attempt to understand what the actual problem was. Switching from a slice to a map just would have made the problem appear randomly (making it even more difficult to debug).
Anyway, the actual fix was just a one-line change.
haha thanks for the real fix!
This PR is related to https://github.com/rivo/tview/issues/987
It seems that the order of adding items into the grid affects the result of the drawing.
This behaviour can be seen with the following example:
We expect the table to be shown differently based on the minimum widths and heights provided.
However, this is what we actually get - the table is shown twice in the large width view.
Strangely, if you change the order of adding of items to the grid, this unexpected behaviour disappears:
It seems that using a
map
fixes this. This was also the original data structure used before https://github.com/rivo/tview/commit/33a1d271f2b6bae5ef63606df05275c2c91b2f86. No other logic is changed.