[GH-ISSUE #987] tview.Table shown incorrectly in tview.Grid #715

Closed
opened 2026-03-04 01:07:14 +03:00 by kerem · 3 comments
Owner

Originally created by @darylhjd on GitHub (May 16, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/987

It seems that the table being shown even though the condition has not been met.

Problem occurs after upgrading to 33a1d271f2. Previous commits work as expected.

Here is code that sets the condition for the table:

grid.AddItem(table, 5, 0, 10, 15, 0, 0, true).
	AddItem(table, 0, 5, 15, 10, 0, 80, true)

github.com/darylhjd/mangadesk@592a08c891/app/ui/manga_page.go (L100)

The "Chapters" table is being shown incorrectly in the large view port.

Expected:
Large view port:
image
Small view port:
image

Actual:
Large view port:
image

Small view port:
image

As can be seen, the table that is meant to be shown in the small view port only is also shown in the large view port.

Originally created by @darylhjd on GitHub (May 16, 2024). Original GitHub issue: https://github.com/rivo/tview/issues/987 It seems that the table being shown even though the condition has not been met. Problem occurs after upgrading to 33a1d271f2b6bae5ef63606df05275c2c91b2f86. Previous commits work as expected. Here is code that sets the condition for the table: ```go grid.AddItem(table, 5, 0, 10, 15, 0, 0, true). AddItem(table, 0, 5, 15, 10, 0, 80, true) ``` https://github.com/darylhjd/mangadesk/blob/592a08c8914eb60f11618af0fd08bd94d4828850/app/ui/manga_page.go#L100 The "Chapters" table is being shown incorrectly in the large view port. **Expected**: Large view port: ![image](https://github.com/rivo/tview/assets/53652695/ed25a5f9-a112-4106-9799-1d36ec49aca9) Small view port: ![image](https://github.com/rivo/tview/assets/53652695/ca231d05-ec9e-4474-9f51-a18ad3bc1591) **Actual**: Large view port: ![image](https://github.com/rivo/tview/assets/53652695/cc734083-4b07-4cd2-a022-40da7e765ed5) Small view port: ![image](https://github.com/rivo/tview/assets/53652695/4e667091-0520-4304-b86a-2a86d69cbd79) As can be seen, the table that is meant to be shown in the small view port only is also shown in the large view port.
kerem closed this issue 2026-03-04 01:07:14 +03:00
Author
Owner

@rivo commented on GitHub (May 19, 2024):

Thanks for reporting this. Indeed, that last change to Grid didn't check for duplicate items in the grid definition. The latest commit should fix this.

<!-- gh-comment-id:2119166924 --> @rivo commented on GitHub (May 19, 2024): Thanks for reporting this. Indeed, that last change to `Grid` didn't check for duplicate items in the grid definition. The latest commit should fix this.
Author
Owner

@darylhjd commented on GitHub (May 24, 2024):

Thanks for the fix, but I tried it again and it seemed the issue persisted which caused me to find out that the order of adding items to the grid affected the result of the drawing.

I have opened another PR to address this https://github.com/rivo/tview/pull/991

<!-- gh-comment-id:2128392747 --> @darylhjd commented on GitHub (May 24, 2024): Thanks for the fix, but I tried it again and it seemed the issue persisted which caused me to find out that the order of adding items to the grid affected the result of the drawing. I have opened another PR to address this https://github.com/rivo/tview/pull/991
Author
Owner

@rivo commented on GitHub (May 24, 2024):

There was still a small bug in the last commit. The latest commit fixes this.

<!-- gh-comment-id:2128666563 --> @rivo commented on GitHub (May 24, 2024): There was still a small bug in the last commit. The latest commit fixes this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#715
No description provided.