Choices icon indicating copy to clipboard operation
Choices copied to clipboard

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

Open djave-co opened this issue 5 years ago • 2 comments

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 avatar Aug 18 '20 10:08 djave-co

any news here?

kricha avatar Mar 08 '23 12:03 kricha