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

select + ng:options does not show all options #464

Closed
vojtajina opened this issue Jul 8, 2011 · 4 comments
Closed

select + ng:options does not show all options #464

vojtajina opened this issue Jul 8, 2011 · 4 comments
Assignees

Comments

@vojtajina
Copy link
Contributor

When changing the number of options available in a select which uses
ng:options all options are not always visible.

See http://jsfiddle.net/pzwQY/6/ for an example. Change from "colors"
to "pets" and back to "colors", the second select will now only show 2
of the 4 colors.

This can also be seen on your example of ng:options at
http://docs.angularjs.org/#!/api/angular.directive.ng:options. Remove
an option and a new one. The last option will not be visible.

@ghost ghost assigned mhevery Jul 8, 2011
@mhevery
Copy link
Contributor

mhevery commented Jul 10, 2011

Unless I am misunderstanding the issue, this works as intended. See http://jsfiddle.net/HucLQ/

  1. select colors and red and notice that the value=red
  2. change colors to pets, and notice that value=red (no change as expected) but the ng:option does not have red in its list, so it resorts do displaying blank.

This is the intended behavior.

@mhevery mhevery closed this as completed Jul 10, 2011
@vojtajina
Copy link
Contributor Author

Try this:

  • open http://jsfiddle.net/HucLQ/
  • check the second select options: red, green, blue, purple
  • change the first select to "pets"
  • check the second select options: cat, dog
  • change the first select back to "colors"
  • check the second select options: red, green (there are only first 2 options displayed) !!!

@vojtajina vojtajina reopened this Jul 10, 2011
@Codier
Copy link
Contributor

Codier commented Jul 11, 2011

I think it does look a bit buggy when the last two options just disappears after switching back to colors from pet

@mhevery
Copy link
Contributor

mhevery commented Jul 11, 2011

I understand now. Please include better repro steps next time. :-)

mhevery added a commit to mhevery/angular.js that referenced this issue Jul 20, 2011
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