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

ng:change doesn't always update the view [ng 10.2] #628

Closed
@ktoso

Description

@ktoso

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions