Closed GabrielKatz closed 1 year ago
Hi @aitboudad , pls suggest if any fix or workaround for this, as the forms are not changing from disabled to enabled state and vice versa.
Just double checking did this break on your upgrade to 6 or on upgrade fr 6.1.4 to 6.1.5
On Tue, May 9, 2023, 10:07 PM pbnichat @.***> wrote:
Hi @aitboudad https://github.com/aitboudad , pls suggest if any fix or workaround for this, as the forms are not changing from disabled to enabled state and vice versa.
— Reply to this email directly, view it on GitHub https://github.com/ngx-formly/ngx-formly/issues/3680#issuecomment-1541266004, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADB4XNNOF76UMD3AK2JMES3XFMBALANCNFSM6AAAAAAXZ3Q354 . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Issue happened when upgraded from version 6.1.3 to 6.1.5
Hi @aitboudad , pls suggest if any fix or workaround for this, as the forms are not changing from disabled to enabled state and vice versa.
use v6.1.4
, I'll try to provide a fix late Today.
Version with bug 6.1.5 Reproduction https://stackblitz.com/edit/ngx-formly-ui-material-hlvjcv?file=src%2Fapp%2Fapp.component.ts Expected behavior Toggle button should toggle the top 3 input fields Actual behavior Toggle does nothing
Probable Error Cause:
With the latest change in formly.field.ts (https://github.com/ngx-formly/ngx-formly/pull/3676/files#diff-df0ae785861eb0347b30fc9d957d41cb17da70920e87a746c2b805817412cd42), the form state is being observed on a field level as opposed to the "global" options level. Because the formly observe()-method only works if there is one observation source, this means that only the last field is updated. If that update does not trigger a change to the form group, the change will not propagate.
One approach could be to make the observe()-method work with several sources, like so:
But i do not know which side-effects such a change might have.