material icon indicating copy to clipboard operation
material copied to clipboard

select(multiple): triggers ng-change on initialization

Open mramanauskas opened this issue 9 years ago • 6 comments

Actual Behavior:

  • What is the issue? * when md-select is used with multiple="true", it initialy triggers ng-change as much times as there is options preselected.
  • What is the expected behavior? ng-change should be triggered only when model value changes.

CodePen (or steps to reproduce the issue): *

  • CodePen Demo which shows your issue: http://codepen.io/rmarius/pen/BzgmGk?editors=0010

Angular Versions: *

  • Angular Version: 1.5.5
  • Angular Material Version: 1.1.0

Additional Information:

  • Browser Type: * Chrome
  • Browser Version: * 52
  • OS: * OSX
  • Stack Traces:

Shortcut to create a new CodePen Demo. Note: * indicates required information. Without this information, your issue may be auto-closed.

Do not modify the titles or questions. Simply add your responses to the ends of the questions. Add more lines if needed.

mramanauskas avatar Aug 25 '16 09:08 mramanauskas

I'm having the same annoying issue...

eric-borland avatar Aug 31 '16 14:08 eric-borland

This appears to be on issue on:

Angular Versions:

Angular Version: 1.5.8 Angular Material Version: 1.1.1

jsmylnycky avatar Oct 13 '16 14:10 jsmylnycky

:+1:

PSkierniewski avatar Oct 13 '16 14:10 PSkierniewski

This is a really troublesome issue. It also gets triggered whenever new options are added to an existing md-select, and those options are pre-selected (this includes replacing the whole list of options). According to the docs for ngChange, it should not be evaluated "if the model is changed programmatically".

objectiveryan avatar Feb 02 '17 08:02 objectiveryan

any news on this? Happening to me also. Not on angular material but a basic input + ngmodel + ngchange

altsanz avatar Jun 01 '18 15:06 altsanz

Verified that this is still an issue in 1.1.9 via updated CodePen.

Splaktar avatar Jun 10 '18 08:06 Splaktar