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

Blur event is not triggering for checkbox #2602

Closed
Janiece19 opened this issue Dec 1, 2020 · 5 comments
Closed

Blur event is not triggering for checkbox #2602

Janiece19 opened this issue Dec 1, 2020 · 5 comments
Labels

Comments

@Janiece19
Copy link

Janiece19 commented Dec 1, 2020

Description
Binding Blur event to a checkbox field in angular formly, it is not triggering event on checkbox click

Minimal Reproduction

https://stackblitz.com/edit/angular-2fvxks?file=src/app/app.component.ts

Your Environment

  • Angular version: 9.1.2
  • Formly version: 5.5.15
@Janiece19 Janiece19 added the bug label Dec 1, 2020
@aitboudad
Copy link
Member

could you please check if the issue exists with our latest version v5.10.6 also which UI you're using?

@Janiece19
Copy link
Author

Janiece19 commented Dec 2, 2020

I am using angular material. Tried with the above version (5.10.6) but no luck

https://stackblitz.com/edit/angular-2fvxks?file=src/app/app.component.ts

@aitboudad
Copy link
Member

This issue has been fixed and released as part of v5.10.7 release.

Please let us know, in case you are still encountering a similar issue/problem.
Thank you!

@peterk7
Copy link

peterk7 commented Dec 9, 2020

Hi @aitboudad,
My project auto-updated to v5.10.7 and a page that contained the boolean type (checkbox) started causing issues and console log errors. (v5.10.6 works fine for us)

We debugged it to this thread and this update.

The problem that we found is with this code (checkbox.type.ts):
ngOnDestroy() { this.focusMonitor.stopMonitoring(this.checkbox._inputElement); }

When updating the form, the resolveFieldTypeRef function gets called (fromly.config.ts) and it calls destroy for every field component:
componentRef.destroy();

Given the checkbox didnt render yet, this.checkbox === undefined and throws a log error: "Cannot read property '_inputElement' of undefined".

Maybe an error check should be added there for that case?

Thanks.

@aitboudad
Copy link
Member

fixed in 5.10.8

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

3 participants