Problem/Motivation
Webform's AJAX response handler in webform.ajax.js uses $('.webform-ajax-refresh') to check if a form refresh button is present. When the AJAX response URL matches the current page, it triggers a click on this element to refresh the form via AJAX instead of doing a full page reload.
The "Reset" button on the webform build form has the webform-ajax-refresh class. When using the Gin admin theme, Gin creates sticky action buttons in the top bar that clone all form submit buttons — including the reset button. These cloned buttons also carry the webform-ajax-refresh class.
The element is added successfully, but then the handler additionally triggers the reset button click, causing an unwanted form submission that reloads the page. This is especially noticeable with "Save + Add element" where the form should stay on the build page without reloading.
Steps to reproduce
- Enable the Navigation module and Gin admin theme.
- Go to a webform build form (Structure > Webforms > Edit > Build).
- Click "Add element" to open the element dialog.
- Add an element and click 'save + add element'.
- Additionally to the element being added, the form resets. The modal to add another element does not open up automaticcally.
Issue fork webform-3582612
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
arthur_lorenz commented