-
Notifications
You must be signed in to change notification settings - Fork 949
Add combobox widget #2390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add combobox widget #2390
Conversation
Commands to try in a notebook: from ipywidgets import Combobox
Combobox(options=['Chocholate', 'Coconut', 'Vanilla'])
Combobox(options=['Chocholate', 'Coconut', 'Vanilla'], ensure_option=True) |
Could we instead simply add a datalist attribute to the existing Text input? |
Sure, but that would change the logic some (options would default to None). Would you still always add the datalist tag, even if options is |
And just for reference: What are the arguments for/against adding to Text vs keeping is separate? |
I was thinking it would be easier for us to maintain and easier for the user (one widget instead of two). However, thinking out continuous_update - it should probably default to false for combobox, but already defaults to true for Text, so maybe that's an argument there for making it a subclass like you have. Can you change the default for continuous_update? Especially if we're selecting from some options, we should only send a change if we're done selecting, rather than every keystroke. |
And especially if one option is a substring of another. Continuous update true guarantees that we'll send the substring before the intended option if we are typing it out, which is probably not what is intended. |
@SylvainCorlay - +1 for getting something like this in (however it ends up in) for 7.5. |
Grumbles 😄 |
@jasongrout / @SylvainCorlay This is already available as a separate package, so no rush from my side to get it in. |
@jasongrout Regarding
|
Hmm, this is a decent counter-example to what I wrote, but makes sense. It is also what I had originally intended (see docstring where it says that |
I think changing the user interaction behavior like this is confusing. I'd rather have continuous_update be explicitly set, rather than changing the default based on another option. |
I am in favour for a separate widget, in most people's minds it is I think.
At least in the frameworks I have seen, and in my mind :)
(from mobile phone)
…On Thu, 25 Apr 2019, 17:07 Jason Grout, ***@***.***> wrote:
Options are meant as hints for auto-completion, but free-form input is
also valid. Here, continuous_update should behave as for Text (IMHO).
I think changing the user interaction behavior like this is confusing. I'd
rather have continuous_update be explicitly set, rather than changing the
default based on another option.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2390 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANPEPO4V5D7QH5TGEV5UTLPSHCMDANCNFSM4HIFE2JQ>
.
|
@jasongrout But I think the other option would still be needed, and that options will still be in conflict with |
Use cases:
|
Are there any other use cases that I'm missing? |
I fixed some performance issues now as well, so now it should be able to handle options in the scale 10k-100k. The worst performance is when changing the options list, due to the large number of DOM-nodes that are added/removed. |
ping @jasongrout ;) |
pong @jasongrout |
I won't be able to review this before 7.5, but it looks like Sylvain is on a review/merge roll. |
Based on adding a <datalist> tag to the <input> of the Text widget.
@vidartf I am fine with merging the current state of the code. We probably want to have a docstring instead of a TODO statement for the release though. Do you have a bit of time to add something there? |
Based on adding a
<datalist>
tag to the<input>
of the Text widget.Fixes #1871.
Fixes #692.