[GH-ISSUE #1057] Add multi-select widget #764

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

Originally created by @SamWhited on GitHub (Nov 23, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/1057

I'm implementing a third party form markup in tview and one widget they have that currently has no equivalent in tview is a "multi-select list". For single selection I've implemented it using tviews DropDown. Having something similar but allowing multiple selection would be nice. I could see this being done in a few ways:

  • Similar to drop down except when the drop down is open each item can be selected or deselected individually without closing the drop-down
  • Similar to List except multiple items may be selected
  • A collection of check-boxes surrounded by a frame with a title for the group

Currently I'm implementing this using individual checkboxes but that's not ideal for a number of reasons. In part because there's no visual indicator that the checkboxes are related or a single group, and there's no way to add a label above the checkboxes matching the form items label (each individual checkbox has the label of the actual item in the multi-select, but the multi-select form fields title cannot be displayed), also submission logic is quite complicated and would be simplified by having a single widget that only gives you a list of the selected values.

This is similar to issue #965, but I believe they are distinct issues as that sounds like a more specialized adaptation of the table widget. I'd be happy to help with any of these depending on what sort of widgets you're interested in having.

Originally created by @SamWhited on GitHub (Nov 23, 2024). Original GitHub issue: https://github.com/rivo/tview/issues/1057 I'm implementing a third party form markup in tview and one widget they have that currently has no equivalent in tview is a "multi-select list". For single selection I've implemented it using tviews DropDown. Having something similar but allowing multiple selection would be nice. I could see this being done in a few ways: - Similar to drop down except when the drop down is open each item can be selected or deselected individually without closing the drop-down - Similar to List except multiple items may be selected - A collection of check-boxes surrounded by a frame with a title for the group Currently I'm implementing this using individual checkboxes but that's not ideal for a number of reasons. In part because there's no visual indicator that the checkboxes are related or a single group, and there's no way to add a label above the checkboxes matching the form items label (each individual checkbox has the label of the actual item in the multi-select, but the multi-select form fields title cannot be displayed), also submission logic is quite complicated and would be simplified by having a single widget that only gives you a list of the selected values. This is similar to issue #965, but I believe they are distinct issues as that sounds like a more specialized adaptation of the table widget. I'd be happy to help with any of these depending on what sort of widgets you're interested in having.
kerem closed this issue 2026-03-04 01:07:34 +03:00
Author
Owner

@SamWhited commented on GitHub (Nov 23, 2024):

My apologies, I had searched for "multi-select" but for some reason that didn't come up with #330 which this appears to be a duplicate of. Closing in favor of the original issue.

<!-- gh-comment-id:2495617914 --> @SamWhited commented on GitHub (Nov 23, 2024): My apologies, I had searched for "multi-select" but for some reason that didn't come up with #330 which this appears to be a duplicate of. Closing in favor of the original issue.
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#764
No description provided.