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

The change event is triggered twice when using the remove Item button #892

Closed
djave-co opened this issue Aug 18, 2020 · 2 comments
Closed
Labels

Comments

@djave-co
Copy link

djave-co commented Aug 18, 2020

Describe the bug
If you click the removeItem button (clearing the input) an event is triggered with the current value, then another event is triggered with the new (empty) value.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codepen.io/EightArmsHQ/pen/45e90d693e81947159b4cac7caf12abd
  2. Click on the first option in the dropdown
  3. Click the cross
  4. Notice that there have now been 3 events in the console.

Expected behavior
The removeItem button should just fire the change event with the new, empty value.

Desktop (please complete the following information):

  • OS: iOS
  • Browser Chrome

Additional context
This bug can be frustrating if you use the change event to trigger a promise, to do something asynchronous, as the results sometimes come back in the wrong order.

@djave-co djave-co added the bug label Aug 18, 2020
@kricha
Copy link

kricha commented Mar 8, 2023

any news here?

@naiemofficial
Copy link

Any update about this?

Xon added a commit to Xon/Choices.js that referenced this issue Jul 28, 2024
…placeholder value being used (match html single-select)

Choices-js#892
@Xon Xon mentioned this issue Aug 6, 2024
9 tasks
@Xon Xon closed this as completed Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants