You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[4.0.0] ion-select interface="action-sheet" not refreshing the items according to the updated model #17344
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>
I'm experiencing the same issue in an a JavaScript (non-Angular) app. The problem seems to be related to the ionSelectOptionDidUnload event not firing correctly, as the demonstrated by this component:
I have this issue on v4.0.1 where the options array within the alert component does not reload, despite the DOM updating with the correct ion-select-option list.
My work around was to add an *ngIf to the ion-select tag and hide the element with an empty array before wrapping the changes in a setTimout().
Looks like it, yes 👍. I pushed a dev build earlier today with this fix if anyone wants to try it out and provide feedback. npm i @ionic/core@dev @ionic/angular@dev
There are some changes to Stencil actively being worked on that we think may resolve this issue. I am going to do some testing with it later this week and will post here when I have an update.
Is there any progress?
This ting still not working.
I'm filtering the list based on some condition, and it's not reflecting in the select list.
`Ionic:
i have the same issue i solve it like this
this.colors = [];
then
setTimeout(() => {
this.colors = this.colors.filter(eachColor => eachColor.id !== color.id);
}, 2);
but i think it is not a practical solution ! coz it not working always
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
davl3232 commentedon Feb 6, 2019
It's not just action-sheet, I tested the 3 possible values for interface and the same happens.
yomatters commentedon Feb 13, 2019
I'm experiencing the same issue in an a JavaScript (non-Angular) app. The problem seems to be related to the
ionSelectOptionDidUnloadevent not firing correctly, as the demonstrated by this component:nickmeulen commentedon Feb 15, 2019
I have this issue on v4.0.1 where the options array within the alert component does not reload, despite the DOM updating with the correct
ion-select-optionlist.My work around was to add an
*ngIfto theion-selecttag and hide the element with an empty array before wrapping the changes in asetTimout().Markup:
Component Example:
brandyscarney commentedon Mar 26, 2019
Thanks for the issue! @liamdebeasi is this fixed by #17860?
liamdebeasi commentedon Mar 26, 2019
Looks like it, yes 👍. I pushed a dev build earlier today with this fix if anyone wants to try it out and provide feedback.
npm i @ionic/core@dev @ionic/angular@devThanks!
frenmanoj commentedon Mar 28, 2019
Hello @liamdebeasi , @brandyscarney ,
Just tried it against the following version. It hasn't been fixed yet 🙁
@ionic/core: 4.2.0-dev.201903262032.a8a48a4liamdebeasi commentedon Mar 28, 2019
Hi there,
Did you install
@ionic/angular@devas well?9 remaining items
liamdebeasi commentedon Apr 1, 2019
Hi everyone,
There are some changes to Stencil actively being worked on that we think may resolve this issue. I am going to do some testing with it later this week and will post here when I have an update.
Thanks!
BDominik commentedon Jul 15, 2019
Is there any progress?
This ting still not working.
I'm filtering the list based on some condition, and it's not reflecting in the select list.
`Ionic:
ionic (Ionic CLI) : 4.10.1 (C:\Users\bdomi\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.3.1
@angular-devkit/build-angular : 0.13.8
@angular-devkit/schematics : 7.3.8
@angular/cli : 7.3.8
@ionic/angular-toolkit : 1.5.1
Cordova:
cordova (Cordova CLI) : not installed
Cordova Platforms : not available
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 6 other plugins)
System:
Android SDK Tools : 26.1.1 (C:\Users\bdomi\AppData\Local\Android\sdk)
NodeJS : v10.15.1 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
`
varogonz95 commentedon Jul 17, 2019
Have you tried splicing the array instead of just re-assigning its value?
This is a recommended practice in AngularJS. Idk if this applies with Angular 2+ as well
digat commentedon Jul 22, 2019
i have the same issue i solve it like this
this.colors = [];
then
setTimeout(() => {
this.colors = this.colors.filter(eachColor => eachColor.id !== color.id);
}, 2);
but i think it is not a practical solution ! coz it not working always
digat commentedon Jul 22, 2019
Any work Around better than y approach ?
BDominik commentedon Jul 23, 2019
I'm hidding the pickers with ngIf and then showing itt quickly.
Ugly but working.
dylanvdmerwe commentedon Aug 22, 2019
Note that this is still happening in
4.8.0.fix(all): component reusage (#18963)
fix(all): component reusage (#18963)
fix(all): component reusage (#18963)
liamdebeasi commentedon Sep 4, 2019
A fix for this is available in Ionic 4.9.0. For any new bugs, please create a new issue.
Thanks!
ionitron-bot commentedon Oct 4, 2019
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.