Closed jarodtang closed 3 years ago
I assume you actually mean a single line Text widget rather than the multiline Textbox widget.
If so, the existing dropdown widget already supports a basic form of searching through the options when you type anything into the widget. Just select the dropdown and start typing the text for the option you want to select.
However, if what you really want is automatic suggestions for a free-form Text widget, there is no current support for this. It's possible to add this as a new type of widget (or possibly as another option on Text) using similar logic to the dropdown widget (but then dynamically changing the dropdown options).
Feels like it could be a good addition to the widgets, but I don't have enough time to add that in the near future. I'd be happy to help you add it, though.
Thanks for your reply. I was point to the "a free-form Text widget", I'll try to figure out a way to implement one.
Cool. As I said before... I'd advise you to look at the way the dropdown widget works and use a similar mechanism for the automatic suggestions. The sneaky bit in the design is how it pops up a completely new Frame over the top of the existing one and then handles everything inside that new Frame.
You'd want to use a similar design, but leave the new Text field in that Frame enabled. Then instead of synching from the Listbox to the Text field, you'd want to repopulate the Listbox with options based on the current text of the Text field as it changes. Finally you probably need to ensure that any selection in the list box updates the Text field and moves the focus back to the Text field so that the user can carry on typing as needed.
Hope that helps. Feel free to drop me a line if you need more pointers.
I'm assuming this was enough help, so now closing...
Hi There,
I'm trying to implement a feature like, there's a drop down option to be selected from, while I'm typing texts in a text box? like following picture.
Are there anyway to do it?
Regards, Jarod