Wappler Version : 7.4.1
Operating System : W11
Server Model: NodeJS
Database Type: NA
Hosting Type: Own Server
Expected behavior
When the modal is hidden, the form inside the modal to be reset
Actual behavior
The form does not reset
How to reproduce
- Form inside a modal
- Enter data
- Cancel the action
- Reopen the modal and the entered data is still visible
This is the code for the modal:
<div class="modal fade" id="mdl_add_safety_contact" is="dmx-bs5-modal" tabindex="-1" dmx-on:hide-bs-modal="safety_contacts_form.reset(true)" dmx-on:hidden-bs-modal="safety_contacts_form.reset()" nocloseonclick="true">
Work around
Reset the form when the Cancel button is used
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" dmx-on:click="safety_contacts_form.reset()">Cancel</button>
and remove the default close button at the top right of the modal while setting the No Close On Click option.