ngx-formly: Question: Typing response is really slow inside a form
Hi, I am opening a Material Dialog that renders a form. This technique is being used in all the app and all is working well.
Except today in a new dialog, there is slowness when typing inside the form fields. This dialog has different implementation than the rest but I made sure I didnโt miss anything from the other implementation.
This new dialog renders a <form> with <formly-form> component.
It has also the OnPush Strategy.
Can you please guide on what to debug in order to know the reason behind this behavior?
Thanks
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (18 by maintainers)
Amazing @aitboudad Glad to know this detail ๐ Long Live formly ๐
just forget about
setTimeout, the root cause of slowness is whenever an event (Keydown) is triggered some components are re-rendered that includeAdminTableComponent. start by commenting some part of your code until you find the component that caused that issue. as from our side, we canโt help much more than that without a reproduction example ๐!the easy way is to modify the source code through the
node_moduleselse build the source code and usenpm link.formly-forminside field typeTwo main part that you can check else there is something wrong on your code:
when using expression properties as we evaluate the expression during
ngDoCheck(Iโm thinking to provide an opt-in to eval only on model change). Comment on the following line https://github.com/ngx-formly/ngx-formly/blob/v5/src/core/src/lib/components/formly.form.ts#L68 and check if that fixes the issue.when using
repeatfield type check the following issue https://github.com/ngx-formly/ngx-formly/issues/1489#issuecomment-479651796