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

Sort buttons don't trigger formSaved event #1596

Open
mateita opened this issue Jan 5, 2025 · 0 comments
Open

Sort buttons don't trigger formSaved event #1596

mateita opened this issue Jan 5, 2025 · 0 comments

Comments

@mateita
Copy link

mateita commented Jan 5, 2025

Description:

This extends #49. I am trying to show a live preview of the form.
The issue can be spotted into the codepen from the original issue (https://codepen.io/kevinchappell/pen/ZQqwLp).

Due to not having a dedicated event for listening to formBuilder data changes such as "onFormDataChange" event or similar, I resorted to listening to the following events simultaneously "formSaved", "fieldEditOpened", "fieldEditClosed".

What I want to achieve is to execute a function (rendering the form) when any of the following happens:

  1. any field is added
  2. any field is removed
  3. any field attribute is edited
  4. fields order changes

The "formSaved" achieves 1, 2 and partly 4. The event is triggered when the fields order changes from drag&drop with sortable, but it doesn't trigger when sort buttons are clicked (field is moved higher or lower).

Environment Details:

  • formBuilder Version: 3.19.13
  • Browser: Chrome
  • OS: MacOS 14.6.1

Expected Behavior

"formSaved" event should be triggered when:

  • fields are moved up or down using the "sort" buttons.
  • fields are dragged and dropped

Actual Behavior

"formSaved" event is NOT triggered when fields are moved up or down using the "sort" buttons.

Steps to Reproduce

https://codepen.io/kevinchappell/pen/ZQqwLp

  1. Add 3+ fields
  2. Drag and drop any field => formRendered form is updated
  3. Click any "sort" button on any field => formRendered form is NOT updated

Screenshot - (optional)

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