Skip to content
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 dropdown option to tag widget #92

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

dnoneill
Copy link
Contributor

@dnoneill dnoneill commented Nov 10, 2021

When adding dropdown: true to tag widget and the widget has a vocabulary defined, it will show the vocabulary as a dropdown instead of a autocomplete text field. This option only allows for one tag. You could also add a free text tag field to annotorious and have both options.

{widget: 'TAG', vocabulary: ['test', 'test2', {'label': 
       'test3', 'uri': 'https://testing.com'}], dropdown: true },
{widget: 'TAG', vocabulary: ['test', 'test2', {'label': 
       'test3', 'uri': 'https://testing.com'}]}

@rsimon
Copy link
Member

rsimon commented Nov 11, 2021

Thanks for this! Although I think I'd rather have a dropdown widget as a separate component, for several reasons:

  • It does work in quite a different way than the normal tag widget
  • Having form-oriented widgets (text input fields, dropdown) is a very frequent request, so this would fit excellently into a collection of form widgets
  • The current widget does have a "dropdown-like" mode already: if you hit the arrow-down key, the widget will display all options

Last but not least: I'm about to start working on a revision of the tag widget next week. The two main goals will be: adding support for async tag sources (i.e. not a list supplied during initialization, but an HTTP fetch from a "tag server"); getting rid of the downshift.js dropdown component, which has been causing as many problems as it solved, and (probably) adds unnecessary bloat to the JS bundle.

I'll try to come up with a first re-org next week, and fit your PR in there, ok?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants