mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 13:55:51 +03:00
[GH-ISSUE #926] *.Box,SetMouseCapture() captures all mouse-events, not only those within the Box #676
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#676
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 @FJuedesOrcl on GitHub (Dec 5, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/926
Hi Friends,
i am not sure if this is intentional, by mistake or technically unavoidable:
Am i doing something wrong? - Please have a look at the code below.
Another question arose while writing the short experimental code:
How can one map the mouse-event coordinates to a TUI-element?
I am using flexible-grid dimensions, so that the dimensions of the elements are depending on the size of the terminal window.
Any hints and recommendations very welcomed!
Best regards from Charleston (WV),
Frank/2
Here is the sample code:
@yxzzy-wtf commented on GitHub (Nov 30, 2025):
Hi @FJuedesOrcl: sorry for the very-late response to this thread. I discovered the same issue when I was building a grid with several MouseCapture events. I was finding that, given a grid, it seems like all items on the "row" would be triggered in sequence.
For example, what I found was, assuming the following grid where [xC] is clickable:
Clicking on 3C will first execute MouseCapture on 1C, then 2C, then 3C.
Clicking on 5C will first execute on 4C, then 5C.
On the off chance that you're still dealing with this (or someone else is dealing with this finds this question), a workaround that fixes it for me is:
The above basically checks that the mouseclick is within the Box coordinates before doing the action. At some point I might dig deeper into the logic that triggers MouseCapture to see if there's an actual bug causing a full row trigger.