-
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
Description
Bug Report
Ionic version:
[x] 4.x
Current behavior:
The second time the PickerController shows the options are not showing correctly.
Expected behavior:
It should show always the right options
Steps to reproduce:
Related code:
Other information:
Ionic info:
Ionic:
ionic (Ionic CLI) : 4.10.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.2
@angular-devkit/build-angular : 0.13.4
@angular-devkit/schematics : 7.3.4
@angular/cli : 7.3.4
@ionic/angular-toolkit : 1.4.0
System:
NodeJS : v10.15.1 (/usr/local/bin/node)
npm : 6.8.0
OS : macOS Mojave
a7md0, patelrikin, jongbonga and LarsFlieger
Metadata
Metadata
Assignees
Labels
package: core@ionic/core package@ionic/core packagetype: buga confirmed bug reporta confirmed bug report
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
liamdebeasi commentedon Mar 4, 2019
Hi there,
Thanks for the issue. Can you share a repository with the code required to reproduce this issue? Thanks!
mariossavva commentedon Mar 5, 2019
Here's a simple example (home.page.ts) from a new blank project. Hope this helps...
liamdebeasi commentedon Mar 5, 2019
Thanks for the code!

Which browser/version are you testing this on? This is what I see when I try it out in a blank Ionic starter app (
ionic start myApp blank
):mariossavva commentedon Mar 6, 2019
@liamdebeasi hi. i am using Chrome 72.
Here are the step that I got the issue:
The first time you select the controller it shows correctly.
Then pick an option say "value 3" and click Ok.
Then the second time you show the picker the options don't show correctly if the selectedIndex is set.
I hope this helps
liamdebeasi commentedon Mar 6, 2019
Thanks for the follow up! I can reproduce this issue. We will look into it!
46 remaining items
carlgik4 commentedon Jun 10, 2021
I got a solution, but I can't reply it on ionicframework.org, then I found similar question here.
Anyway, this is my solution:
If you want to update options, you could make the options same count, such as first time you have 5 items, second time 10 items, you can pad them all to above 10 items, such as 100 items, all the padding items, you can mark them as disable, these disabled items will not be displayed, but the animation seems correct.
1st time:
options: [{text, value, disabled: false}..., {text, value, disabled: true}...] // 100items
2nd time:
options: [{text, value, disabled: false}..., {text, value, disabled: true}...] // 100items
It also works with picker.addEventListener('ionPickerColChange', async (event: any) => {}
It seems someone also has the same solution, I wondered why ionic team doesn't fix this issue, it bothers me for several hours.
reza3vi commentedon Sep 18, 2021
yetkinaykan commentedon Dec 1, 2021
This problem persists in ionic 5 react version. (useIonPicker)
wall-street-dev commentedon Jan 14, 2022
As a workaround, I'm cleaning the original array of columns' options before showing the picker.
Here's a full example
sean-perkins commentedon Mar 24, 2022
Hello everyone 👋
Can someone please test with this dev build and let me know if you continue to run into any issues?
You should not need any workarounds for deleting values off the object.
ionitron-bot commentedon May 4, 2022
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.