Skip to content

Commit

Permalink
fix(simple-combo): value & selection correct single type instead array
Browse files Browse the repository at this point in the history
  • Loading branch information
damyanpetev committed Nov 8, 2023
1 parent c0e1ac2 commit deff69b
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 160 deletions.
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

0 comments on commit deff69b

Please sign in to comment.