Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

IE9 Select Boxes Emptied on Click/Change #1826

Closed
sonicparke opened this issue Jan 17, 2013 · 2 comments
Closed

IE9 Select Boxes Emptied on Click/Change #1826

sonicparke opened this issue Jan 17, 2013 · 2 comments

Comments

@sonicparke
Copy link

In IE9 when you click or change the option in a select box all the other select boxes on the page are emptied of their selected value.

http://jsfiddle.net/sonicparke/2CqKY/

@frimfram
Copy link

Hi,
I have a fix for this and hopefully I can get pull request going.
In the meantime, the workaround for this is to set the model value to null in the control code as follows:

var app = angular.module('myApp',[]);
app.controller('AppController', function($scope) {
$scope.selectItems = [{"func":"cert","name":"User1"},
{"func":"cert","name":"User2"},
{"func":"struct","name":"User3"},
{"func":"struct","name":"User4"},
{"func":"hdrs","name":"User5"},
{"func":"hdrs","name":"User6"},
{"func":"null","name":"User7"},
{"func":"null","name":"User8"},
{"func":"eng","name":"User9"},
{"func":"eng","name":"User10"}];

$scope.initialOption1 = null;
$scope.initialOption2 = null;
$scope.initialOption3 = null;

});

ghost pushed a commit to configit/angular.js that referenced this issue Mar 15, 2013
Fixes a check inside render for select elements with ngOptions, which compares the selected property of an element with it's desired state.
In instances where no element should be selected, this resulted in the first option in the select element having it's selected attribute set from undefined to false.
In most browsers, this has the effect of displaying the first item in the list. In IE9 however, this causes the select to display nothing.
In other browsers this would still cause unnecessary changes in selected state, but no visible issue would manifest.

Closes angular#2150, angular#1826
ghost pushed a commit to configit/angular.js that referenced this issue Mar 20, 2013
Fixes a check inside render for select elements with ngOptions, which compares the selected property of an element with it's desired state.
Ensured the placeholder, if available, is explicitly selected if the model value can not be found in the option list.
Without these fixes it's up to the browser implementation to decide which option to choose.
In most browsers, this has the effect of displaying the first item in the list. In IE9 however, this causes the select to display nothing.

Closes angular#2150, angular#1826
petebacondarwin pushed a commit that referenced this issue May 7, 2013
Fix a check inside render for select elements with ngOptions, which
compares the selected property of an element with it's desired state.
Ensure the placeholder, if available, is explicitly selected if the model
value can not be found in the option list.
Without these fixes it's up to the browser implementation to decide which
option to choose. In most browsers, this has the effect of displaying the
first item in the list. In IE9 however, this causes the select to display
nothing.

Closes #2150, #1826
petebacondarwin pushed a commit that referenced this issue May 7, 2013
Fix a check inside render for select elements with ngOptions, which
compares the selected property of an element with it's desired state.
Ensure the placeholder, if available, is explicitly selected if the model
value can not be found in the option list.
Without these fixes it's up to the browser implementation to decide which
option to choose. In most browsers, this has the effect of displaying the
first item in the list. In IE9 however, this causes the select to display
nothing.

Closes #2150, #1826
@btford btford closed this as completed Aug 24, 2013
@btford
Copy link
Contributor

btford commented Aug 24, 2013

As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months.

Please try the newest versions of Angular (1.0.8 and 1.2.0-rc.1), and if the issue persists, comment below so we can discuss it.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants