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

fix(simple-combo): value & selection correct single type instead array #13647

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ All notable changes for each version of this project will be documented in this
- `ISimpleComboSelectionChangingEventArgs` exposes two new properties `newSelection` and `oldSelection` in place of the old ones that are no longer affected by `valueKey` and consistently emit items from Combo's `data`.

Note: In remote data scenarios with `valueKey` set, selected items that are not currently part of the loaded data chunk will be emitted a partial item data object with the `valueKey` property.
- **Breaking Change** The `value` and `selection` properties now correctly return a single value or data item instead of the same wrapped in array and `undefined` instead of empty array, matching the values emitted from selection event and when working with `formControlName`/`ngModel` directives.

## 16.1.4
### New Features
- `Themes`:
Expand Down
2 changes: 1 addition & 1 deletion projects/igniteui-angular/src/lib/combo/combo.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
}

/**
* The value of the selected item in the combo
* The value of the combo
*
* ```typescript
* // get
Expand Down
5 changes: 3 additions & 2 deletions projects/igniteui-angular/src/lib/simple-combo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,9 @@ Setting `[displayDensity]` affects the control's items' and inputs' css properti
| Name | Description | Type |
|--------------------------|---------------------------------------------------|-----------------------------|
| `id` | The combo's id. | `string` |
| `data` | The combo's data source. | `any` |
| `value` | The combo's value. | `string` |
| `data` | The combo's data source. | `any[]` |
| `value` | The combo's value. | `any` |
| `selection` | The combo's selected item. | `any` |
| `allowCustomValue` | Enables/disables combo custom value. | `boolean` |
| `valueKey` | Determines which column in the data source is used to determine the value. | `string` |
| `displayKey` | Determines which column in the data source is used to determine the display value. | `string` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<ng-content select="igx-suffix"></ng-content>
</ng-container>

<igx-suffix *ngIf="selection.length" aria-label="Clear Selection" class="igx-combo__clear-button"
<igx-suffix *ngIf="hasSelectedItem" aria-label="Clear Selection" class="igx-combo__clear-button"
(click)="handleClear($event)">
<ng-container *ngIf="clearIconTemplate">
<ng-container *ngTemplateOutlet="clearIconTemplate"></ng-container>
Expand Down
Loading
Loading