ipywidgets icon indicating copy to clipboard operation
ipywidgets copied to clipboard

add Combobox behaviour to new TagsInput widget

Open jgunstone opened this issue 4 years ago • 1 comments
trafficstars

hi there,

the new TagsInput looks like a great new addition to ipywidgets - many thanks @martinRenou !

my understanding is that it currently it supports the following behaviour:

  • user free field tags (when allowable_tags = None). i.e. the user can add any tags they want.
  • tags from dropdown list (when allowable_tags = a user defined list). i.e. the user can only add any tags that are in the allowable_tags list.

Problem

it would be great if it also supported:

  • tags from Combobox type behaviour (i.e. the user can select from dropdown list or type in a tag that doesn't exist).

Proposed Solution

suggested options:

  • add a "suggested_tags" argument. if this is used instead of "allowable_tags" then users get a dropdown list of tags but can also add tags that don't exist in that list
  • change the argument name "allowable_tags" to "options" (more similar to other widgets), and add boolean arg called "ensure_option" which defines if the user can add tags that don't exist or not. note "ensure_option" is the same arg name used for the Combobox widget.

Additional context

here is where tags input is defined: https://github.com/jupyter-widgets/ipywidgets/blob/13fb8066c6a44fa57b8667de7959de6bd20f3bca/ipywidgets/widgets/widget_tagsinput.py#L20

example from docs: https://github.com/jupyter-widgets/ipywidgets/blob/master/docs/source/examples/Widget%20TagsInput.ipynb

jgunstone avatar Aug 08 '21 17:08 jgunstone

it seems a pretty good extension. Is there any news about it?

paoloalba avatar Jan 30 '22 16:01 paoloalba