iTwin / iTwinUI-react

A react component library for iTwinUI.
https://github.com/iTwin/iTwinUI
Other
84 stars 23 forks source link

Combobox onChange doesn't honor updated dependencies #635

Closed klopez213 closed 2 years ago

klopez213 commented 2 years ago

Describe the bug (actual behavior)

When dependencies change in the useCallback() , combobox doesn't honor this update.

Expected behavior

Combobox onChange should use the updated dependencies.

Reproduction

Link to a minimal repro: https://codesandbox.io/s/combobox-onchange-noformik-t55umm?file=/src/App.tsx

Steps to reproduce
  1. Select a skill in Combobox skill.
  2. Verify skill is set.
  3. Select the same skill.

Expected Result: It should show the alert that the user selected the same skill. Actual Result: It re-sets the skill.

Additional information:

Didn't check if onBlur behaves the same way or not.

mayank99 commented 2 years ago

Thanks for the issue @klopez213 this is now fixed in 1.37.1 🚀