Thanks. Always having a blank option actually meets by web app requirements.
On Sunday, 26 July 2015 11:20:37 UTC+5:30, fasfsfgs wrote: > > I don't have Safari 7.1 here so I couldn't reproduce the bug but have you > tried to always have a blank option? > And would you be ok with that? > > I had another bug <https://github.com/angular/angular.js/issues/7042> > with select and ngOptions that was solved by making a blank option always > available.. > > <div ng-controller="MyCtrl"> > <select > ng-model="form.type" > ng-change="alphabetClicked(selectedAlbhabet)" > ng-options="option.value as option.name for option in > typeOptions"> > <option value=""></option> > </select> > form.type={{form.type}} > </div> > > > > > On Sat, Jul 25, 2015 at 11:39 PM, Sandeep Bhandari <[email protected] > <javascript:>> wrote: > >> When creating the select in angularjs, I have not given any selected >> value initially so a blank option is shown initially. As soon as user >> selects any option, the blank option is auto removed by browsers and the >> selected option is displayed correctly. But Safari 7.1 is not able to do >> so. In Safari 7.1 if a user selects any other option say option number 3, >> the select will remove the blank option and display option number 2 as >> selected instead of option number 3. The user is raising concern over it as >> he intended to choose option 3 but browser is showing option 2. >> >> >> My Code is: HTML: >> >> <div ng-controller="MyCtrl"> <select ng-model="form.type" >> ng-change="alphabetClicked(selectedAlbhabet)" ng-options="option.value as >> option.name for option in typeOptions" > </select> form.type={{form.type}} >> </div> >> >> JavaScript: >> var myApp = angular.module('myApp',[]); function MyCtrl($scope) { >> $scope.typeOptions = [ { name: 'Feature', value: 'feature' }, { name: 'Bug', >> value: 'bug' }, { name: 'Enhancement', value: 'enhancement' } ]; >> //$scope.form = {type : $scope.typeOptions[0].value}; } >> >> jsfiddle: http://jsfiddle.net/4qKyx/176/ >> >> My question: what workaround should I use so that on selecting any option >> in select, Safari 7.1 also displays the intended selected option. >> >> *Note:* I am ok with the first option as being blank as it means user >> needs to select some option and currently nothing is selected by the user. >> Once user makes a choice I am also ok with auto removal of blank option. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "AngularJS" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at http://groups.google.com/group/angular. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
