-1

So i have the following element:

<div class="input-field col s12">
   <select [(ngModel)]="view.frequency" >
      <option value="" disabled selected>Vælg hyppighed</option>
      <option [value]="1">Aldrig</option>
      <option [value]="2">Sjældent</option>
      <option [value]="3">En gang imellem</option>
      <option [value]="4">Ofte</option>
      <option [value]="5">Altid</option>
   </select>
   <label>Vælg hyppighed</label>
</div>

Now on chrome this produces the following result:

enter image description here

however on edge it seems to ignore the disabled option and sets the default to the first value Aldrig:

enter image description here

Can anyone tell me whats going on here?

1

1 Answer 1

2

Remove selected in option value you used disabled and selected only use disable then you get value 1 option

   <div class="input-field col s12">
      <select [(ngModel)]="view.frequency" >
          <option value="" disabled>Vælg hyppighed</option>
          <option [value]="1">Aldrig</option>
          <option [value]="2">Sjældent</option>
          <option [value]="3">En gang imellem</option>
          <option [value]="4">Ofte</option>
          <option [value]="5">Altid</option>
      </select>
      <label>Vælg hyppighed</label>
  </div>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.