-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ComboBox controlled state behavior bug fix (#2048)
Co-authored-by: Rohan Kadkol <45748283+rohan-kadkol@users.noreply.github.com> Co-authored-by: Mayank <mayank99@users.noreply.github.com>
- Loading branch information
1 parent
3595174
commit 9277c26
Showing
8 changed files
with
316 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@itwin/itwinui-react": patch | ||
--- | ||
|
||
Fixed a bug in `ComboBox` where the `isSelected` passed to `itemRenderer` was always `false` whenever `multiple` was `true`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@itwin/itwinui-react": minor | ||
--- | ||
|
||
Fixed a bug in `ComboBox` where the controlled state (`value` prop) was not given priority over the uncontrolled state. | ||
|
||
As a result: | ||
* Setting the default value using `value={myDefaultValue}` will no longer work. Instead, use the new `defaultValue` prop. | ||
* Resetting the value using `value={null}` will now force the ComboBox to be in *controlled* mode. If you want to reset the value but be in *uncontrolled* mode, then use `value={undefined}` instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@itwin/itwinui-react": minor | ||
--- | ||
|
||
Added a new `defaultValue` prop to `ComboBox`. This is useful when you don't want to maintain your own state but still want to control the initial `value`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.