fix(grid): order of adding items should not affect drawing - #991
Closed
darylhjd wants to merge 1 commit into
Closed
Conversation
Owner
|
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. |
Contributor
Author
|
haha thanks for the real fix! |
kopecmaciej
pushed a commit
to kopecmaciej/tview
that referenced
this pull request
Aug 27, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is related to #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
mapfixes this. This was also the original data structure used before 33a1d27. No other logic is changed.