kendo-angular icon indicating copy to clipboard operation
kendo-angular copied to clipboard

FilterInputDirective of kendo-angular-grid always calls setDisabledState of the value accessor

Open elca-lan opened this issue 5 years ago • 0 comments

Describe the bug I have a custom component in a grid filter that implements the Angular ControlValueAccessor but does not implement the optional setDisabledState method - see https://angular.io/api/forms/ControlValueAccessor . This used to work with older versions of the grid, but fails with the current version @progress/[email protected] with the exception

Error: this.accessor.setDisabledState is not a function; Stacktrace: TypeError: this.accessor.setDisabledState is not a function
    at FilterInputDirective.set disabled [as disabled]
    ...

To Reproduce I don't have a minimal sample at this point, but the simple fact that the code in FilterInputDirective looks like this

set disabled(value) {
    this.accessor.setDisabledState(value);
}

in combination with the interface definition of ControlValueAccessor

interface ControlValueAccessor {
  // ...
  setDisabledState(isDisabled: boolean)?: void // note the question mark => optional
}

should be enough to justify the bug report.

Expected behavior The filter input directive should not fail with a correctly implemented control value accessor.

Browser irrelevant

elca-lan avatar Jan 22 '20 09:01 elca-lan