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

How to make bootstrap classes not disappear when removing a field from a row and putting it in an empty place #1575

Closed
giannicolac opened this issue Jul 2, 2024 · 8 comments · Fixed by #1579

Comments

@giannicolac
Copy link

Description:

Hello, i have a question. When i put two elements on a row, and then take one of them outside of it, it loses the bootstrap classes it had by default. I have enableEnhancedBootstrapGrid and enableColumnInsertMenu as true. I would like the elements to keep the classes after the process.

Environment Details:

  • formBuilder Version: 3.19.7
  • Browser: Firefox
  • OS: Linux Mint

Expected Behavior

For the elements to keep the classes when taken out of a row.

Actual Behavior

They lose the col, row and form-control classes

@giannicolac giannicolac changed the title How to make bootstrap classes not dissapear when removing a field from a row and putting it in an empty place How to make bootstrap classes not disappear when removing a field from a row and putting it in an empty place Jul 2, 2024
@lucasnetau lucasnetau added the bug label Jul 3, 2024
@lucasnetau
Copy link
Collaborator

Hi @giannicolac , thank you for your report. I can reproduce the form-control class bring dropped, will investigate why.

row and col I cannot reproduce being dropped, they are recalculated when moving to a new row

@giannicolac
Copy link
Author

The loss of col and row doesn't seem to happen in the DOM, but when getting the data, such classes are gone in my case, even if they are in the DOM elements and the "class" in the panel has them.

@lucasnetau
Copy link
Collaborator

Please test out #1579, I've rewritten the syncFieldWithNewRow function which was corrupting the className string when dropped.

@giannicolac
Copy link
Author

I replaced my form-builder.js file in src/js with the one you changed, but it doesnt seem to have changed anything about the behavior. The form-control classes disappear, and row and col are not in the data.

@lucasnetau
Copy link
Collaborator

Hi @giannicolac did you ensure to rebuild after applying the patch? I've done additional refactoring this morning and also added Jest test cases plus manual testing. Classes are no longer being mangled

@lucasnetau
Copy link
Collaborator

Please try this patched version form-builder.min.js.gz

@giannicolac
Copy link
Author

This made it work, thank you.

Copy link

github-actions bot commented Jul 7, 2024

🎉 This issue has been resolved in version 3.19.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

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