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.

bug: select is not checking the option with checked on it

See original GitHub issue

The following test failed on snapshot: select/single-value

Relevant code:

<ion-item>
  <ion-label stacked>Label 6</ion-label>
  <ion-select [(ngModel)]="gender">
    <ion-option value="f" checked="true">Female</ion-option>
    <ion-option value="m">Male</ion-option>
  </ion-select>
</ion-item>

screen shot 2016-07-15 at 5 42 22 pm

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
saiprasad2595commented, Feb 23, 2018

I did workaround.In constructor i have set ngModel value for which i thought of keeping default selected value.

<ion-select [(ngModel)]='selectBox'>
    <ion-option value='male'>Keep data from view</ion-option>
     <ion-option value='female'>Remove data from view</ion-option>
</ion-select>

---
constructor(){
 this.selectBox = 'male';
}

---

This way default value is getting selected

1reaction
abrseqcommented, Dec 15, 2017

what i did was after executing all the line of codes in the ionChange event i made [(ngModel)] value null… After that its working fine

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: select is not checking the option with checked on it · Issue ...
I'm curious as to how this should behave. Let's say that the gender variable would be "m" in this situation. What should the...
Read more >
Angular Material 9 : How to fix a bug in a mat-form-field inside ...
I want to filter some objects inside a mat-select, but once i hit the space key in the search box, the first element...
Read more >
Check spelling and grammar in Office - Microsoft Support
Spell check documents manually or automatically as you type, or turn spell check off. Run grammar and spell checker manually to proof your...
Read more >
Check spelling and grammar on Mac - Apple Support
Check spelling and grammar on Mac. In many macOS apps, spelling is checked while you type, and mistakes are automatically corrected.
Read more >
Select | Angular Material
This error is thrown if you attempt to assign a value other than null , undefined , or an array to a <mat-select...
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