Skip to content

Commit deff69b

Browse files
committed
fix(simple-combo): value & selection correct single type instead array
1 parent c0e1ac2 commit deff69b

File tree

6 files changed

+174
-160
lines changed

6 files changed

+174
-160
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ All notable changes for each version of this project will be documented in this
2828
- `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`.
2929

3030
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.
31+
- **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.
32+
3133
## 16.1.4
3234
### New Features
3335
- `Themes`:

projects/igniteui-angular/src/lib/combo/combo.common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
795795
}
796796

797797
/**
798-
* The value of the selected item in the combo
798+
* The value of the combo
799799
*
800800
* ```typescript
801801
* // get

projects/igniteui-angular/src/lib/simple-combo/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,9 @@ Setting `[displayDensity]` affects the control's items' and inputs' css properti
272272
| Name | Description | Type |
273273
|--------------------------|---------------------------------------------------|-----------------------------|
274274
| `id` | The combo's id. | `string` |
275-
| `data` | The combo's data source. | `any` |
276-
| `value` | The combo's value. | `string` |
275+
| `data` | The combo's data source. | `any[]` |
276+
| `value` | The combo's value. | `any` |
277+
| `selection` | The combo's selected item. | `any` |
277278
| `allowCustomValue` | Enables/disables combo custom value. | `boolean` |
278279
| `valueKey` | Determines which column in the data source is used to determine the value. | `string` |
279280
| `displayKey` | Determines which column in the data source is used to determine the display value. | `string` |

projects/igniteui-angular/src/lib/simple-combo/simple-combo.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<ng-content select="igx-suffix"></ng-content>
2525
</ng-container>
2626

27-
<igx-suffix *ngIf="selection.length" aria-label="Clear Selection" class="igx-combo__clear-button"
27+
<igx-suffix *ngIf="hasSelectedItem" aria-label="Clear Selection" class="igx-combo__clear-button"
2828
(click)="handleClear($event)">
2929
<ng-container *ngIf="clearIconTemplate">
3030
<ng-container *ngTemplateOutlet="clearIconTemplate"></ng-container>

0 commit comments

Comments
 (0)