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

Enhancement Request: Use Mat Dialog for Confirmation Pop-up in Form.io Form Builder #1025

Closed
aravindps04 opened this issue Oct 26, 2023 · 1 comment
Labels

Comments

@aravindps04
Copy link

Issue Description:

I am trying to implement a confirmation pop-up before the removal of components in Form.io Form Builder. Currently, Form.io uses a flag called "alwaysConfirmComponentRemoval" to show a confirmation, but it utilizes the window.confirm modal for this purpose. I believe that using the Mat Dialog from Angular Material would provide a more modern and user-friendly experience.

I attempted to achieve this using the change event, but I encountered an issue where the element is being cleared before the Mat Dialog can be displayed.

Proposed Solution:

I suggest implementing a Mat Dialog for the confirmation pop-up when removing components in Form.io Form Builder. This would involve making the following changes:

Replace the usage of window.confirm with an Angular Material Mat Dialog to display the confirmation message.

Ensure that the component removal is only performed if the user confirms the action within the Mat Dialog.

Adjust the event handling to accommodate the asynchronous nature of the Mat Dialog.

Additional Information:

I attempted to implement this feature myself by using the change event to trigger the Mat Dialog. However, the component was removed before the dialog could be displayed. I believe that modifying the event handling logic or implementing a proper confirmation dialog would resolve this issue.

Please consider this enhancement request, as it would greatly improve the user experience and the overall quality of the Form.io Form Builder.

Thank you for your attention to this matter.

@daneformio
Copy link

There is an option to enable a confirmation option, alwaysConfirmComponentRemoval. See the help documentation for more information: https://help.form.io/developers/form-development/form-builder#form-builder-options

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

No branches or pull requests

2 participants