-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Closed
Labels
package: core@ionic/core package@ionic/core packagetype: buga confirmed bug reporta confirmed bug report
Milestone
Description
Bug Report
Ionic version:
4.0.0
Current behavior:
The ion-select action sheet correctly renders the initial list of items. But if an item is removed programmatically from the model, the action-sheet interface doesn't reflect that. That is, if you click on the dropdown to open the action-sheet interface, it still contains the deleted item in the list.
Expected behavior:
The ion-select action sheet interface does not display the deleted item from the model.
Steps to reproduce:
Let's say I have a select dropdown defined as below. When an item is removed by click on Delete Color button, the model colors get updated. But if we click on the dropdown, the action-sheet interface still shows the delete color.
*.html
<ion-select interface="action-sheet" [(ngModel)]="selectedColor">
<ion-select-option *ngFor="let eachColor of colors;"
[value]="eachColor">
{{eachColor.label}}
</ion-select-option>
</ion-select>
...
<ion-button (click)="deleteColor(selectedColor)">
Delete Color
</ion-button>
*.ts
colors = [{ id: 1, label: 'Red' },
{ id: 2, label: 'Green' },
{ id: 3, label: 'Blue' }];
selectedColor = this.colors[0];
...
deleteColor(color) {
this.colors = this.colors.filter(eachColor => eachColor.id !== color.id);
this.selectedColor = this.colors[0];
}
Other information:
Ionic info:
Ionic:
ionic (Ionic CLI) : 4.10.0
Ionic Framework : @ionic/angular 4.0.0
@angular-devkit/build-angular : 0.12.3
@angular-devkit/schematics : 7.2.3
@angular/cli : 7.2.3
@ionic/angular-toolkit : 1.3.0
Cordova:
cordova (Cordova CLI) : 8.1.2 ([email protected])
Cordova Platforms : android 7.1.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-webview 2.3.2, (and 11 other plugins)
System:
Android SDK Tools : 26.1.1
ios-deploy : 2.0.0
NodeJS : v8.11.3
npm : 5.6.0
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61
davl3232, yomatters, nickmeulen, vially, btsiders and 1 more
Metadata
Metadata
Assignees
Labels
package: core@ionic/core package@ionic/core packagetype: buga confirmed bug reporta confirmed bug report