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

Open
#1,134 2 comments 0 reactions 1 assignee View on GitHub

@Tatsiana8 is already working on this.

Since Apr 30, 2025.

Assessment

This issue has not been assessed yet.

Description

question
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 :)

Dominant language
TypeScript
Stars
706
Forks
493
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from formio/angular

All issues in formio/angular

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.