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

Form is rendering before data submission is ready #5929

Open
celu opened this issue Nov 28, 2024 · 0 comments
Open

Form is rendering before data submission is ready #5929

celu opened this issue Nov 28, 2024 · 0 comments

Comments

@celu
Copy link

celu commented Nov 28, 2024

I'm using formio with Angular,

Then I'm creating a form with a component that in advanced logic as javascript trigger condition that uses a var owner = data.OWNER; that depends on data.

When the form is created in angular with
Formio.createForm(
            document.getElementById('formio'),
            this.form,
            options,
        ).then((form) => {
           form.submission = this.formioSubmission;
}

The data arrives if i display a console.log but the console log prints multiple times undefined before gettings its value since the form is being rendered and the data is then loaded at the submission so the owner = data.OWNER; executes before the data is available.

Is there a better approach to use the data of the form or to wait until the form is rendered or is it a bug?

Version/Branch
Formiojs: 4.21.4
Formio/angular: 7.0.0

Expected behavior
Getting the data values before JavaScript in logic trigger is loaded.

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

No branches or pull requests

1 participant