Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression are not getting executed if value is changed in custom component #3915

Closed
Sankey1506 opened this issue May 16, 2024 · 1 comment
Closed
Labels

Comments

@Sankey1506
Copy link

Sankey1506 commented May 16, 2024

I am using Formly with Kendo Components.

I have a custom field called switch. On Switch toggle I have to enable or disable the text field.
It used to work in v5 but not in v6.
Do I have to do any additional changes in if has to work in v6.

Here is my minimal reproduction: https://stackblitz.com/edit/angular-b43wet-djjn2p

@Sankey1506 Sankey1506 changed the title Expression are not getting executed if value is changed in custom component [How to] Expression are not getting executed if value is changed in custom component May 16, 2024
@Sankey1506 Sankey1506 changed the title [How to] Expression are not getting executed if value is changed in custom component Expression are not getting executed if value is changed in custom component May 16, 2024
@aitboudad
Copy link
Member

aitboudad commented May 26, 2024

Its working fine, the issue is in your custom field type. To update the switch value, please rely on formControl:

  @HostListener('click') toggleSwitch() {
    if (!this.props.disabled) {
+     this.formControl.setValue(!this.isChecked);
-     this.model['' + this.key] = !this.model['' + this.key];
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants