material icon indicating copy to clipboard operation
material copied to clipboard

mdSelect handles empty string value incorrectly

Open vfeskov opened this issue 11 years ago • 4 comments

Consider this code:

<div ng-init="themodel=''">
  <md-select ng-model="themodel">
    <md-option value="">None</md-option>
    <md-option>Blue</md-option>
    <md-option>Green</md-option>
  </md-select>
  {{themodel}}
</div>

When you run it, select will not have "None" active, and when you select "None" the model value becomes "0" instead of empty string.

Demonstration using address example from the website: http://codepen.io/anon/pen/rOVdrq

vfeskov avatar Sep 08 '15 16:09 vfeskov

I encountered this same problem while using version 0.11.0 but updating to 0.11.3 and 0.11.4 has fixed this issue. md-select now return an empty string (as expected) instead of 0

timtimmytime avatar Oct 22 '15 15:10 timtimmytime

Marking as fixed.

rschmukler avatar Nov 04 '15 18:11 rschmukler

is this issue fixed ? am getting same issue .Iam working on rc4

satheesh786 avatar Nov 20 '15 04:11 satheesh786

@satheesh786 per this demo it seems to be fixed

rschmukler avatar Nov 20 '15 22:11 rschmukler