diff --git a/tns-core-modules/ui/list-picker/list-picker-common.ts b/tns-core-modules/ui/list-picker/list-picker-common.ts index 2231d3e98..f6e4b1c77 100644 --- a/tns-core-modules/ui/list-picker/list-picker-common.ts +++ b/tns-core-modules/ui/list-picker/list-picker-common.ts @@ -46,7 +46,6 @@ export const itemsProperty = new Property({ name: "items", valueChanged: (target, oldValue, newValue) => { let getItem = newValue && (newValue).getItem; target.isItemsSource = typeof getItem === "function"; - selectedIndexProperty.coerce(target); } }); itemsProperty.register(ListPickerBase); diff --git a/tns-core-modules/ui/list-picker/list-picker.android.ts b/tns-core-modules/ui/list-picker/list-picker.android.ts index ccbbd2c4c..fe0349f8e 100644 --- a/tns-core-modules/ui/list-picker/list-picker.android.ts +++ b/tns-core-modules/ui/list-picker/list-picker.android.ts @@ -137,6 +137,9 @@ export class ListPicker extends ListPickerBase { let maxValue = value && value.length > 0 ? value.length - 1 : 0; this.android.setMaxValue(maxValue); this._fixNumberPickerRendering(); + + // Coerce selected index after we have set items to native view. + selectedIndexProperty.coerce(this); } get [colorProperty.native](): { wheelColor: number, textColor: number } { diff --git a/tns-core-modules/ui/list-picker/list-picker.ios.ts b/tns-core-modules/ui/list-picker/list-picker.ios.ts index fa37343ec..cfe5a132f 100644 --- a/tns-core-modules/ui/list-picker/list-picker.ios.ts +++ b/tns-core-modules/ui/list-picker/list-picker.ios.ts @@ -46,6 +46,9 @@ export class ListPicker extends ListPickerBase { } set [itemsProperty.native](value: any[] | ItemsSource) { this.ios.reloadAllComponents(); + + // Coerce selected index after we have set items to native view. + selectedIndexProperty.coerce(this); } get [backgroundColorProperty.native](): UIColor {