[GH-ISSUE #77] Editable DropDowns #57

Closed
opened 2026-03-04 01:01:31 +03:00 by kerem · 5 comments
Owner

Originally created by @muesli on GitHub (Mar 13, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/77

Essentially a combination of an InputField and a DropDown: let the user enter a custom text or pick an item from the DropDown list (the address bar in your browser would be an example of such a UI widget).

Originally created by @muesli on GitHub (Mar 13, 2018). Original GitHub issue: https://github.com/rivo/tview/issues/77 Essentially a combination of an InputField and a DropDown: let the user enter a custom text or pick an item from the DropDown list (the address bar in your browser would be an example of such a UI widget).
kerem closed this issue 2026-03-04 01:01:31 +03:00
Author
Owner

@rivo commented on GitHub (Mar 13, 2018):

I understand what you describe here. (And I would probably describe this as some kind of "autocomplete" functionality for InputField primitives.) Is this something that you currently require in an application you're developing? Or is it just a general idea that you had?

<!-- gh-comment-id:372732471 --> @rivo commented on GitHub (Mar 13, 2018): I understand what you describe here. (And I would probably describe this as some kind of "autocomplete" functionality for `InputField` primitives.) Is this something that you currently require in an application you're developing? Or is it just a general idea that you had?
Author
Owner

@muesli commented on GitHub (Mar 13, 2018):

Besides being a fairly common and convenient UI component, I'm actually writing a little systemd service manager (https://github.com/muesli/service-tools) which would directly benefit from such a feature.

<!-- gh-comment-id:372734129 --> @muesli commented on GitHub (Mar 13, 2018): Besides being a fairly common and convenient UI component, I'm actually writing a little systemd service manager (https://github.com/muesli/service-tools) which would directly benefit from such a feature.
Author
Owner

@rivo commented on GitHub (Mar 15, 2018):

So there are two solutions I can think about:

  1. Extending the DropDown component so that you can enter text. This text will only be used to find a matching option in the drop-down list (the ones which have your entered text as a prefix). This basically helps the user jump to the desired option quickly.
  2. Adding "autocomplete" functionality to the InputField. When the user enters text, a callback function is invoked which returns a list of matches. Those matches are then shown in a drop-down list and the user can choose from that list (using the up and down arrow keys).

In the first solution, you can still only select from the options defined from the start. In the second solution, the user may choose to ignore the options presented to them and instead type whatever they want.

So these are different ideas. Let me know which one you are looking for in your application.

<!-- gh-comment-id:373462878 --> @rivo commented on GitHub (Mar 15, 2018): So there are two solutions I can think about: 1. Extending the `DropDown` component so that you can enter text. This text will only be used to find a matching option in the drop-down list (the ones which have your entered text as a prefix). This basically helps the user jump to the desired option quickly. 2. Adding "autocomplete" functionality to the `InputField`. When the user enters text, a callback function is invoked which returns a list of matches. Those matches are then shown in a drop-down list and the user can choose from that list (using the up and down arrow keys). In the first solution, you can still only select from the options defined from the start. In the second solution, the user may choose to ignore the options presented to them and instead type whatever they want. So these are different ideas. Let me know which one you are looking for in your application.
Author
Owner

@muesli commented on GitHub (Mar 18, 2018):

I think both solutions would be nice additions to tview's behavior.

Regarding

  1. It would probably be enough to select/jump to the matching item when a user starts typing.
  2. I like the callback idea a lot (this is probably the feature I'd currently need the most)
<!-- gh-comment-id:373969823 --> @muesli commented on GitHub (Mar 18, 2018): I think both solutions would be nice additions to tview's behavior. Regarding 1. It would probably be enough to select/jump to the matching item when a user starts typing. 2. I like the callback idea a lot (this is probably the feature I'd currently need the most)
Author
Owner

@rivo commented on GitHub (Mar 18, 2018):

Ok. So the DropDown primitive now allows you to type to directly jump to matching options.

Autocomplete in InputField will take a bit more effort. Not sure if I will have this very soon.

<!-- gh-comment-id:374038446 --> @rivo commented on GitHub (Mar 18, 2018): Ok. So the `DropDown` primitive now allows you to type to directly jump to matching options. Autocomplete in `InputField` will take a bit more effort. Not sure if I will have this very soon.
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#57
No description provided.