mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 13:55:51 +03:00
[GH-ISSUE #793] frames: tab navigation and unpredictable mouse focusing #581
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#581
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 @carpii on GitHub (Jan 16, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/793
I have a UI with this hierarchy..
Tab cycling..
When I tab through the form inputs, focus cycles back to the top of the form.
So there appears to be no way to tab to the next frame, it's only possible by using the mouse.
There's an argument to be made that TAB should propagate up the hierarchy, and focus the next frame (and so the table)
Mouse focusing
Even when resorting to the mouse, clicking within a frame is a bit unpredictable as to whether the frame gets focused or not
Below is a screenshot of my test app...
And again, showing the mouse regions which do not focus the frame..
RED: clicking here will never focus the frame
AMBER: clicking here will focus the frame maybe 60% of the time. It's hard to identify why sometimes it works, and other times does nothing
Sample code:
@rivo commented on GitHub (Mar 20, 2023):
Thanks for the report. I fixed the issue where a mouse click on a form outside any form item didn't focus it.
Regarding tab cycling, I understand that examples can be created where the expectation for pressing tab at the end of a form would be to focus on the next flex item. At the same time, counter-examples can be provided where this would be unintuitive. That is because people use the
Flexcomponent for much more complex layouts where flex items are again otherFlexcomponents or where flex items are read-only elements (e.g.TextView) which should not be focused. Or look atGrid(or evenPages) where there is no clear "order" of elements.For this reason, I decided to keep the focus within one component and leave it up to the user to manage switching between components themselves. There are lots of ways to do this and every user of
tviewwill use what's appropriate for their application.I will keep this open so I can read your comments if you still have any. Otherwise, feel free to close this issue.
@carpii commented on GitHub (Mar 23, 2023):
Thanks for the mouse-focus fix.
I understand your reasoning about tab propagation. I need to spend a bit of time understanding how I can tackle this at app level, so will close this issue for now.