Skip to content

ion-select delayed population fails to show selected item #17225

@andleer

Description

@andleer

Bug Report

Ionic version:

[x] 4.x

Current behavior:
Setting the [(ngModel)] on an component fails when there is a ~55 ms or more delay between OnInit and the population of the various elements. This typically occurs when populating the values via an API call but it can be demonstrated with a simple delay. The correct option is selected but not shown. If you click on the drop down caret, the value instantly displays.

Expected behavior:
The component should show the correct value.

Steps to reproduce:
Introduce a 100ms delay between OnInit and populating the control.

Related code:

https://github.com/andleer/ionic4-select-bug/

// with delay, component fails to show selection
setTimeout(() => {
   this.widgets = this.pseudoApiSource;
}, 200);

Other information:

Ionic info:

 cli packages: (C:\Users\andrew\AppData\Roaming\npm\node_modules)

   @ionic/cli-utils  : 2.0.0-rc.3
   ionic (Ionic CLI) : 4.0.0-rc.3

System:

   NodeJS : v10.15.0
   npm    : 6.4.1
   OS     : Windows 10

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions