-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
[4.0.0-beta.17] Conditional ion-select-option not updating #16453
Comments
Could be related to #15716. |
Could be but it does not look like that ticket has been picked up. |
This is still an major issue in beta.17! |
I think you are correct. Thanks for connecting them. I think once this is fixed both should be addressed. |
is there any chance we can handle the dynamic selection of options via i am facing an issue in rendering the selected options. they become visible when i click the select component. i think there is some issue with change detection. |
Hi there, Thanks for the issue! We have pushed a nightly build containing some fixes for loading/re-loading select options. Would you be able to try it out in your app and let me know if the issue you are running into here is fixed? ( Thanks for your patience as we work to resolve this issue! |
Hi @liamdebeasi, unfortunately it still does not work.. |
Hi @Maarcel, Thanks for checking! Do you have a code snippet I can use to reproduce this issue? Thanks! |
For example i have an array with numbers. When i change the numbers array this has no effect to the |
Hey @liamdebeasi ! Is there an update on this? I'm the same exact scenario as @Maarcel, however my select options will update only if the array of numbers is greater than the previous. So if it started at 25 and I updated it to 30, it would work. But if I then change it to 29 or lower, no update occurs... |
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. Also linking #17344 since it seems to be related. Thanks! |
Hi everyone, The updates to Stencil need a little bit more time. I will update everyone when I more to share. We appreciate your patience as we work to resolve this issue. Thanks! |
Hey @liamdebeasi ! Do you have an estimate timeline on this? Or maybe a temporary fix we can do on our end? Thanks! |
Hi, |
Ditto what @Ladeiras asked. Just to be persistent :) A part of my app really depends on this working properly |
+1 |
Any solution on this? |
As a workaround, I'm just rendering two distinct select boxes that I'm toggling between: <ion-select *ngIf="myCondition">
<ion-select-option>A</ion-select-option>
<ion-select-option>B</ion-select-option>
<ion-select-option>C</ion-select-option>
</ion-select>
<ion-select *ngIf="!myCondition">
<ion-select-option>A</ion-select-option>
<ion-select-option>C</ion-select-option>
</ion-select> It's brute force, but it works. |
Thank you for your answer I did exactly the same thing. :D |
other solution on this? |
A fix for this is available in Ionic 4.9.0. For any new bugs, please create a new issue. Thanks! |
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. |
Bug Report
Ionic Info
Run
ionic info
from a terminal/cmd prompt and paste the output below.Describe the Bug
I have a select box in which the items contain a integer value. When this integer value is decreased below zero we try to hide the item with an *ngIf. However the item remains and the label of the ion-select does not update. This only happens when the limit of 0 is reached and the ngif is triggered.
if is add a button that ngif's the entire ion-select and toggle it on and off then it does update.
Steps to Reproduce
Steps to reproduce the behavior:
Related Code
<ng-container *ngFor="let productCredit of productCredits"> <ion-select-option *ngIf="productCredit.bookableCredit > 0" [value]="productCredit">{{ productCredit.label }}</ion-select-option> </ng-container> <ion-button (tap)="changedBookableCreditToLessThanZero()">Push me<ion-button>
Expected Behavior
The values in a ion-select should update visually, in my case the should dissappear because i ng-iffed them.
Additional Context
List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, screenshots, OS if applicable, etc.
The text was updated successfully, but these errors were encountered: