Choices icon indicating copy to clipboard operation
Choices copied to clipboard

Trigger changeQuery event when user inputs something into the search field

Open SanderKleykens opened this issue 4 years ago • 1 comments

Description

This closes #944 by triggering a changeQuery event as soon as the user inputs something into the search field.

Types of changes

  • [ ] Chore (tooling change or documentation change)
  • [ ] Refactor (non-breaking change which maintains existing functionality)
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • [x] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [x] I have updated the documentation accordingly.

SanderKleykens avatar Apr 16 '21 11:04 SanderKleykens

This looks like a great addition, but right now it won't function as intended. A changeQuery event will be fired every time a key is pressed, even if it doesn't actually change the query (i.e. arrow keys, delete/backspace keys when the query box is empty, etc.). I think you want to hook into the input event instead. We aren't doing that already, so you'll need to add an _onInput method to Choices.

Please also rebase on the latest version of the master branch.

mtriff avatar Dec 31 '21 03:12 mtriff