Resolve "Fix disabled attribute with reactive form warning"
About the issue
The warning comes when using directly the html disabled
attribute within a template, on a control that is using a formControl, or formControl name.
This goes for both native form elements (such as <input >
, <select>
etc), as well as custom form elements using the controlValueAccessor interface. In this case we had one of each.
About the fix
The first case was within the select query widget component. This was using the rcc-radio-select component, and was setting a disable
attribute directly. This needed to be removed and replaced with the internally tracked isDisable
state
The second case was from the rcc-pull-down component. This, as well as being a controlValueAccessor itself, also was internally using an <input >
element, which had a formControl on it. This had a disabled attribute set on it, which needed to be removed, and replaced with a call to formControl.disable()
/ formContorl.enable()
These were the only culprits I could find, but it's possible there are others that I didn't find
Diagnosing the error
In case it happens again, it's easy enough to find where the error is coming from. Within the warning there's a stack trace, and you just need to look for the first file that's coming from us:
Closes #883 (closed)