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

I have set confirmation before removing component of formio form builder. confirmation dialog showing but when i cancel its still remove component #5541

Open
parmodkumarr opened this issue Mar 20, 2024 · 2 comments

Comments

@parmodkumarr
Copy link

builder = await Formio.builder(document.getElementById('builder'), value, {})
builder.on('removeComponent', function(component) {
if (!confirm("Are you sure you want to remove this component?")) {
return false;
}
});

@parmodkumarr parmodkumarr changed the title i have set confirmation before removing component of formio form builder. confirmation dialog showing but when i cancel its still remove component I have set confirmation before removing component of formio form builder. confirmation dialog showing but when i cancel its still remove component Mar 20, 2024
@lane-formio
Copy link
Contributor

Could you please provide some more information? What version are you using? Could you provide an example (like via jsfiddle) or supply a video?

@parmodkumarr
Copy link
Author

I found the solution configure alwaysConfirmComponentRemoval:true in options like this

builder = await Formio.builder(document.getElementById('builder'), {}, {
alwaysConfirmComponentRemoval:true
});

But, I want to like sweet alert not window confirmation dialog
please let me know if we can modify removeComponent functionality

jsfiddle link:

https://jsfiddle.net/parmodkumar/vw35z74h/2/

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

2 participants