question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ionic V4 ion-select default model value not showed

See original GitHub issue

Hello Ionic Team

I have this code:

<ion-grid> <ion-row align-items-center> <ion-col size="3"><ion-label>Objekt</ion-label></ion-col> <ion-col size="9"> <ion-select [(ngModel)]="currentObjektId" placeholder="Objekt Auswahl" class="myCustomSelect" (ionChange)="changeObjekt()" multiple="false" okText="OK" cancelText="abbrechen" [interfaceOptions]="selectOptions"> <ion-select-option *ngFor="let o of objekte" [value] = "+(o.id)">{{o.kurzname}}</ion-select-option> </ion-select> </ion-col> </ion-row> </ion-grid>

I load currentObjektId (number) and the select does not show the element, however when one clicks the select and the object is already selected.

objekte : { id: number,kurzname: string, online_id: number, admin: number,bilder: number }[];

Ionic Information:

ionic (Ionic CLI) : 4.10.2 (C:\Users-—\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : @ionic/angular 4.0.0-rc.1 @angular-devkit/build-angular : 0.11.4 @angular-devkit/schematics : 7.1.4 @angular/cli : 7.1.4 @ionic/angular-toolkit : 1.2.3

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1) Cordova Platforms : android 7.1.4 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.0.0, (and 23 other plugins)

System:

Android SDK Tools : 26.1.1 (C:\Users-—\AppData\Local\Android\android-sdk) NodeJS : v8.9.4 (C:\Program Files\nodejs\node.exe) npm : 4.6.1 OS : Windows 10

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
MASP3000commented, Mar 7, 2019

Hello. No, my Repo works fine, I mean, without the Problem. I thought that maybe someone else could uses the Repo to introduce his Code and reproduces the problem.

Am Do., 7. März 2019 um 15:22 Uhr schrieb Liam DeBeasi < notifications@github.com>:

Hi @MiguelSyll https://github.com/MiguelSyll,

Does the repo you posted have a reproduction of this issue? I know you said in your previous post that you were unable to reproduce the problem again.

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic/issues/17485#issuecomment-470543583, or mute the thread https://github.com/notifications/unsubscribe-auth/AGbN0WFGztrsjutOTVHWjZNzZlJzZA00ks5vUSC4gaJpZM4a5d4L .

0reactions
ionitron-bot[bot]commented, Apr 6, 2019

Thanks for the issue! This issue is being closed due to the lack of a reply. 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.

Thank you for using Ionic!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ion-select and default values (ionic 4) [Solved]
use ion-select selector; use [(NgModel)] to store selected value; with options in an *ngFor loop; set as default value selected one of these ......
Read more >
Why is the default value of my ion-select not being displayed?
The matching between the model value and the dom value is type sensitive. Vanilla dom properties are always strings and won't match the ......
Read more >
ion-select not showing initial value : r/ionic - Reddit
I am upgrading my V3 app to V4 and struggling to get my ion-select to show the pre-selected value. Always worked in V3...
Read more >
Angular and Ionic Select Setting values Example - Mobiscroll
The select has no selected value by default. You can however manually set a default value through the defaultSelection option. This value will...
Read more >
Ionic 3 How To Set Ion Option As Selected - StackBlitz
Starter project for Ionic apps that exports to the Ionic CLI. ... <ion-select [(ngModel)]="signup.state" ... <p>Selected Value : {{signup.state}}</p>.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found