AutocompleteInput accepts the chosen item only at the second time or trial

I think some behavior of AutocompleteInput that I observed may be due to bugs:

  1. I have completions = [‘aaa’, ‘bbb’, ‘ccc’, ‘ddd’] . If I type in ‘aa’ then ‘aaa’ appears in the suggestion list, which is expected. I select ‘aaa’ from the suggestion but ‘aa’ is handed over to the callback, while I belive the natural behavior should be that ‘aaa’ is selcted. Right after this, I re-type ‘aa’ and choose ‘aaa’ from the suggestion list, then now ‘aaa’ is handed over to the callback. No matter what the completions list is, AutocompleteInput accepts the chosen item only at the second time or trial.

  2. The suggestion list only shows up when I type at least two letters. Why isn’t one character enough?

Here is a code snippet that I used:

from bokeh.models.widgets import AutocompleteInput
from bokeh.layouts import layout
from bokeh.io import curdoc

values = ['aaa', 'bbb', 'ccc', 'ddd']

choices = AutocompleteInput(completions=values, value = values[0], title='Choose')

def update(new):
    print(new)

choices.on_change('value', lambda att, old, new: update(new))

update(choices.value)

l = layout([
    [choices],
], sizing_mode='fixed')

curdoc().add_root(l)
curdoc().title = 'UI Test'

Hi,

···

On Wed, Sep 27, 2017 at 6:45 AM, Sijun Cho [email protected] wrote:

I think some behavior of AutocompleteInput that I observed may be due to bugs:

  1. I have completions = [‘aaa’, ‘bbb’, ‘ccc’, ‘ddd’] . If I type in ‘aa’ then ‘aaa’ appears in the suggestion list, which is expected. I select ‘aaa’ from the suggestion but ‘aa’ is handed over to the callback, while I belive the natural behavior should be that ‘aaa’ is selcted. Right after this, I re-type ‘aa’ and choose ‘aaa’ from the suggestion list, then now ‘aaa’ is handed over to the callback. No matter what the completions list is, AutocompleteInput accepts the chosen item only at the second time or trial.
  1. The suggestion list only shows up when I type at least two letters. Why isn’t one character enough?

Here is a code snippet that I used:

from bokeh.models.widgets import AutocompleteInput
from bokeh.layouts import layout
from [bokeh.io](http://bokeh.io) import curdoc


values = ['aaa', 'bbb', 'ccc', 'ddd']

choices = AutocompleteInput(completions=values, value = values[0], title='Choose')

def update(new):
    print(new)


choices.on_change('value', lambda att, old, new: update(new))

update(choices.value)

l = layout([
    [choices],
], sizing_mode='fixed')

curdoc().add_root(l)
curdoc().title = 'UI Test'

Autocomplete widget is currently broken. Here’s https://github.com/bokeh/bokeh/issues/6822 at least one of relevant issues.

Mateusz

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/4a5fb723-9371-4558-9632-1245a6b98576%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.