On modal hide/hidden, the form does not reset

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

  1. Form inside a modal
  2. Enter data
  3. Cancel the action
  4. 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.

If your using Bootstrap 5 with no jQuery then it is the same bug as Possible Bug in shown-bs-tab Event - Wappler General / Bugs - Wappler Community. I have posted an update there to fix the issue, will be released with the next update.

1 Like

Fixed in Wappler 7.5.1