Describe the bug
Select.onChange is triggered when Select.options is changed,
even though Select.value didn't change.
According to the docs:
onChange (value: T | Array) => void
Event handler called when the value changes.
To Reproduce
https://stackblitz.com/edit/github-kgvrt2gr-ess6xamn?file=src%2Froutes%2Findex.tsx
- Click on "Add new option to Select" button
- View the
Select.onChange trigger count incremented even though the value didn't change.
Expected behavior
Updating Select.options shouldn't trigger Select.onChange.
According to the docs Select.onChange should only trigger when Select.value changes.
Describe the bug
Select.onChangeis triggered whenSelect.optionsis changed,even though
Select.valuedidn't change.According to the docs:
To Reproduce
https://stackblitz.com/edit/github-kgvrt2gr-ess6xamn?file=src%2Froutes%2Findex.tsx
Select.onChange trigger countincremented even though the value didn't change.Expected behavior
Updating
Select.optionsshouldn't triggerSelect.onChange.According to the docs
Select.onChangeshould only trigger whenSelect.valuechanges.