[GH-ISSUE #98] switch focus in multiple embeded flex does not work #77

Closed
opened 2026-03-04 01:01:43 +03:00 by kerem · 1 comment
Owner

Originally created by @stephencheng on GitHub (Apr 9, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/98

I am trying to put up a layout like this:

image

I have my demo code here: https://gitlab.com/cmdemo/demobin/tree/master/tview/tabs

I have pretty much copied the presentation demo code but change a little bit with flex layout.

A few things:

  1. I will have to use between setfoucs and run to make it work, even though I have the code: AddItem(table, 0, 1, true). Your presentation code does not explicitly declare SetFoucs other than the Navigate function. It works but I just couldn't figure this out why.

  2. When I select Navigate in list, it has a highlight on table, but the arrow key up/down does not switch the focus onto table but remains in list. I have tried many ways to try to resolve it, including removing the : app.SetInputCapture but no luck.

The only thing I could think it might be that there are quite a few layers of flex and it's getting confused how to switch the foucs, or is this could be a bug?

Thanks

Originally created by @stephencheng on GitHub (Apr 9, 2018). Original GitHub issue: https://github.com/rivo/tview/issues/98 I am trying to put up a layout like this: ![image](https://user-images.githubusercontent.com/1396675/38504189-5caeea28-3c57-11e8-89ef-5603068ca0eb.png) I have my demo code here: https://gitlab.com/cmdemo/demobin/tree/master/tview/tabs I have pretty much copied the presentation demo code but change a little bit with flex layout. A few things: 1. I will have to use between setfoucs and run to make it work, even though I have the code: AddItem(table, 0, 1, true). Your presentation code does not explicitly declare SetFoucs other than the Navigate function. It works but I just couldn't figure this out why. 2. When I select Navigate in list, it has a highlight on table, but the arrow key up/down does not switch the focus onto table but remains in list. I have tried many ways to try to resolve it, including removing the : app.SetInputCapture but no luck. The only thing I could think it might be that there are quite a few layers of flex and it's getting confused how to switch the foucs, or is this could be a bug? Thanks
kerem closed this issue 2026-03-04 01:01:43 +03:00
Author
Owner

@stephencheng commented on GitHub (Apr 10, 2018):

Sorry, it's my bad. I spent a the whole day on this and just spotted the problem.

The app declaration being duplicated and it just didn't work in that way.

<!-- gh-comment-id:380095372 --> @stephencheng commented on GitHub (Apr 10, 2018): Sorry, it's my bad. I spent a the whole day on this and just spotted the problem. The app declaration being duplicated and it just didn't work in that way.
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#77
No description provided.