ControlValueAccessor.setDisabledState is not reliably checked for presence before calling #11719

Closed
xealot opened this Issue Sep 19, 2016 · 0 comments

Comments

Projects
None yet
3 participants
@xealot

xealot commented Sep 19, 2016

I'm submitting a ... (check one with "x")

[x] bug report

Current behavior

The ControlValueAccessor interface recently received a new optional method, setDisabledState. There are places in the form handling code that do not check if the setDisabledState method is present before invoking it.

if (this.control.disabled) this.valueAccessor.setDisabledState(true);

if (this.control.disabled) this.valueAccessor.setDisabledState(true);

image

Expected behavior

Setting disables state should either always be checked, implemented in some base class or abstract way or have some function that things can call to encapsulate the optional call.

Reproduction of the problem

Set disabled on a form with components that do not implement setDisabledState

  • Angular version: 2.0.0
  • Browser: all
  • Language: all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment