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

ng:options selects wrong element in the view when null option is present #599

Closed
IgorMinar opened this issue Oct 17, 2011 · 2 comments
Closed
Assignees
Milestone

Comments

@IgorMinar
Copy link
Contributor

see: http://jsfiddle.net/IgorMinar/CHVbb/176/

@ghost ghost assigned mhevery Oct 17, 2011
@TEHEK
Copy link
Contributor

TEHEK commented Oct 17, 2011

I think i know where this thing comes from...

This thing occurs if you have no blank tag inside your select but the value of the bound variable is undefined or not belongs to the given set.

In fact, it adds <option value=''?'> which is called 'unknown' in the code. When you make a selection, it attempts to remove the 'unknown' option from thus causing this value shift. I observed this behavior earlier but thought it was caused by the fact that i had too many selects on my page... I'll try to fix it in my null-option related branch...

@TEHEK
Copy link
Contributor

TEHEK commented Oct 17, 2011

*3rd paragraph correction:

  • In fact, it adds <option>

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

Successfully merging a pull request may close this issue.

3 participants