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

Have an event fired when a page is added/removed inside the builder in a wizard form #5561

Open
llemire opened this issue Apr 10, 2024 · 0 comments

Comments

@llemire
Copy link

llemire commented Apr 10, 2024

Is your feature request related to a problem? Please describe.
We want to save the schema of a form inside our application state, to do so, we subscribe to 3 events: addComponent, removeComponent and updateComponent. When any of these event is fired, we make a copy of the schema from the builder instance.

When we have a wizard form and we remove a page, the removeComponent event is fired, but when we get the schema of the form, it still contains the page that was just deleted.

Our current work around is to subscribe to the 'change' event instead of the 3 other event, this is suboptimal since the 'change' event is fired for other reasons than just when the schema is updated, so it causes unnecessary processing.

Describe the solution you'd like
A new event could be fired when a page of a wizard form is added/removed

Describe alternatives you've considered
The 'removeComponent' event could be fired after the page has been removed from the schema.

Additional context
After some investigation, We discovered that the removeComponent event is fired for the removal of the Panel inside the page, but the logic that removes the page inside the WizardBuilder is done after the event is fired, so the schema is invalid has not yet been completely updated when the event is fired.

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