angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

Created "null" option into select ng-options sets to false when other option is clicked

Open mjmlopes opened this issue 7 years ago • 1 comments

I'm submitting a ...

  • [ ] regression from 1.7.0
  • [ ] security issue
  • [ ] issue caused by a new browser version
  • [x] other

Current behavior: Entering a page which has an hardcoded option with null value gets the parameter selected="false" and creating problems on Chrome when new data is put on the object supplied in ng-options.

Expected / new behavior: The parameter selected="false" could be dropped when not selected. When selected, could just be selected This was fixed in https://github.com/angular/angular.js/commit/27486bd15e70946ece2ba713e4e8654b7f9bddad but looks like is not used on select options.

Minimal reproduction of the problem with instructions: On this example plunkr, the default option can be left as is, then by clicking on the button "add", on Chrome only, the select box will change to the option called "none". On Firefox, only page source is changed.

AngularJS version: 1.7.8

Browser: Chrome 78.0.3904.97 (64 bit) (select button displays wrong data) Firefox 68.2.0esr (64-bit) (only visible on page source, rendered select box keeps the same) (both running in Debian 9)

Anything else: Using jquery 2.2.4 Could be related with https://github.com/angular/angular.js/issues/16916 due to ambiguity of the selected option which should be displayed.

mjmlopes avatar Nov 18 '19 18:11 mjmlopes

This doesn't happen with jquery 3.x or without jquery. I suggest you upgrade to jquery 3.x.

Narretz avatar Feb 24 '20 20:02 Narretz