mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
[GH-ISSUE #1108] SetFocus not working before app starts for primitives inside Flex #805
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#805
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 @ivoGanev on GitHub (Aug 2, 2025).
Original GitHub issue: https://github.com/rivo/tview/issues/1108
Not sure if this is a bug, a feature, or something else, but when trying to set focus on the middle pannel in the code bellow - before the app starts - nothing happens; on the other side after the app starts running, and I press F1, the middle pannel is set on focus without a problem.
Also, setting the middle to
truelike this does not workI have a use case where I want to select a default panel before the app start. I don't see any callbacks to set a focus after the app starts either. Is this a bug?
@MonkeyMatrix commented on GitHub (Aug 9, 2025):
I have not worked much with the project, but I believe this is due to SetRoot focusing your
layout. This is found below:github.com/rivo/tview@a4a78f1e05/application.go (L808-L820)I believe you can just add
.SetFocus(middle)to the provided code.@ivoGanev commented on GitHub (Aug 9, 2025):
@MonkeyMatrix, thanks, that worked. I should have been a bit more curious about what’s going on in the codebase.