ng:change doesn't always update the view [ng 10.2] #628
Description
Hey guys,
I've bumped into a bug in angular 10.2.
Here's a js fiddle to show the problem: http://jsfiddle.net/ktoso/RRzKG/22/
The idea is to either enter a new name for something, or select it from the list.
If you select an item, the textbox should be cleared (the variable for it),
if you type in a name of a new category, the select box should be reset (and it's bound variable too of course).
Steps to reproduce:
- enter some category name into the text box
- select some category, it did reset the textbox just fine
- now type some text into the texbox again
- error the select box will not be reset, even though it's variable was nulled (and the log displays the right number of "clearing selected category code" messages).
Expected result:
The select box should be reset to the " -- choose category -- " element at all times when it's value is null.
Hack to fix it:
It's possible to hack-fix this issue by adding this.defer();
into the last line of each clear...
method.
Update 1:
The same thing is happening when implemented using $watch
.
Update 2:
It's supposedly working in 10.4 hmmm... So maybe it's a non issue I guess.
Thanks a lot in advance for taking a look at it.
Cheers 🍺,
Konrad