mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #700] Table search-bar without changing focus #511
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#511
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 @quantumsheep on GitHub (Feb 8, 2022).
Original GitHub issue: https://github.com/rivo/tview/issues/700
This is more of a question than an issue/feature request.
Is it possible to simply implement a search-bar along with a table without having to change focus between the two ?
I'm actually doing this with a custom
Flexwidget I made but I would love it if it's already implemented natively.@darkhz commented on GitHub (Feb 10, 2022):
Yes it is possible. If you could explain your use case more clearly, I could explain better. But generally, you can focus on the InputField, and map certain InputField events like KeyUp,KeyDown etc. (via SetInputCapture) to be sent to the table's InputHandler.
Test this code for instance, you can type in the InputField as well as select columns in the Table.
@rivo commented on GitHub (Feb 16, 2022):
Thanks, @darkhz. That's an elegant solution.
But to answer the specific question, only one primitive can have focus at any given time.
You could also capture events in the
Flexcomponent. Depends on what you want to achieve.@rivo commented on GitHub (Dec 17, 2022):
I'm closing this as it looks resolved to me.