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

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

Open
1 of 4 tasks
mjmlopes opened this issue Nov 18, 2019 · 1 comment
Open
1 of 4 tasks

Comments

@mjmlopes
Copy link

mjmlopes commented Nov 18, 2019

I'm submitting a ...

  • regression from 1.7.0
  • security issue
  • issue caused by a new browser version
  • 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.

@Narretz
Copy link
Contributor

Narretz commented Feb 24, 2020

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

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

2 participants