Skip to content

[Question] About the decision of use setFormFromSrc() only OnInit and not OnChange on Form lifecycle #1134

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

Open
Patcire opened this issue Apr 12, 2025 · 2 comments
Assignees
Labels

Comments

@Patcire
Copy link

Patcire commented Apr 12, 2025

Hello guys!

I was implementing some formio tasks at work last friday and we needed to change dinamically between differents Forms. When I changed @ Input() src the component was'nt re-render itself, so I needed to force it manually playing with value based condition and the method detectChanges().

The solution works but this behaviour looked strange to me so I've been reading the source code of "FormioBaseComponent"

lines 284 and 291

and saw that the method that control that "setFormFromSrc()" it's only used OnInit.

Powerful as it is render a Formio Form in our Angulars projects only with the src value, why is it not watched the changes to trigger a re-render? I imagine that there is a good reason, but I can't see it and I'm curious about it!

Thank you in advance :)

@lane-formio lane-formio assigned olgabann and Tatsiana8 and unassigned olgabann Apr 30, 2025
@formio formio deleted a comment from lane-formio Apr 30, 2025
@ZenMasterJacob20011
Copy link
Contributor

Thank you for brining this to our attention. It should behave the way you are describing. We will create a ticket for this and put it in our backlog.
https://formio.atlassian.net/browse/FIO-10120

@daneformio
Copy link

We would also be able to review a PR if it is provided.

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

No branches or pull requests

5 participants