mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #761] If a DropDown opens over another flex container, mouse clicks don't get recognized and the DropDown doesn't close as expected #554
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#554
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 @MarvinJWendt on GitHub (Sep 15, 2022).
Original GitHub issue: https://github.com/rivo/tview/issues/761
Description
When a
DropDownopens over another flex container, the options cannot be clicked with the mouse. It also does not close properly (leaves the part, that is reaching into another flex container, open).DropDown opened
DropDown closed
Reproduction code
@rivo commented on GitHub (Sep 16, 2022):
The mouse handling for drop-downs was indeed buggy. Thanks for catching this. The latest commit fixes this.
Regarding the lingering option, there are two things to consider:
Flexhas "nothing" in it. So it also doesn't delete anything. You may want to put aBoxin there instead. (See code below.)tcell.ColorDefault. It never works the way you would expect. See the FAQ for more details.@MarvinJWendt commented on GitHub (Sep 16, 2022):
Thanks for the fast fix!
Yes, that makes sense.
The DefaultColor works on all my tested terminals (Windows Terminal, IntelliJ Integrated Terminal, VS Code Integrated Terminal, macOS iTerm).
The linked tcell issue says:
But there is an ANSI Code for default colors:

AFAIK, the ANSI Default Color code is rendered as the background color of the terminal. It's true that not every terminal supports it, but I haven't come across one.
@rivo commented on GitHub (Sep 16, 2022):
To be honest, I'm not that familiar with the capabilities of different terminals. @gdamore from
tcellis the expert here. I do know that we had issues withColorDefaultin the past and the solution was always to pick a specific colour. Also, people often ask for default colours in a sense thattviewmight adjust accordingly on dark terminals (black background) or light terminals (white background) but my understanding is that this can't be made to work reliably on a variety of terminals. But iftcellends up finding a way to do this somehow, I'm happy to include it intview.