Skip to content

fix(mvc): skip abpAjaxForm submission when default is already prevented#25260

Merged
EngincanV merged 1 commit into
rel-10.2from
fix/abp-ajax-form-check-default-prevented
Apr 15, 2026
Merged

fix(mvc): skip abpAjaxForm submission when default is already prevented#25260
EngincanV merged 1 commit into
rel-10.2from
fix/abp-ajax-form-check-default-prevented

Conversation

@maliming

Copy link
Copy Markdown
Member

When the jquery-form plugin was replaced with a custom abpAjaxForm implementation, the isDefaultPrevented() check was lost. The old plugin skipped submission if another handler had already called preventDefault(), but the new implementation always proceeds unconditionally.

This caused issues for modal forms with custom submit handlers (e.g. DelegateNewUserForm in Authority Delegation), where both the custom handler and abpAjaxForm would fire, resulting in an unwanted extra POST to window.location.href.

This restores the old jquery-form plugin's behavior by checking e.isDefaultPrevented() before proceeding.

Copilot AI review requested due to automatic review settings April 14, 2026 12:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores the previous jquery-form plugin behavior in abpAjaxForm by skipping AJAX submission when another submit handler has already prevented the default action, avoiding unintended duplicate POSTs (notably in modal forms with custom submit logic).

Changes:

  • Added an early e.isDefaultPrevented() guard in the submit.abpAjaxForm handler to exit without performing AJAX submission.
  • Preserved existing preventDefault() behavior for normal abpAjaxForm-handled submissions.

@maliming maliming requested a review from EngincanV April 15, 2026 07:04
@maliming maliming added this to the 10.2-patch milestone Apr 15, 2026
@EngincanV EngincanV merged commit 2e50517 into rel-10.2 Apr 15, 2026
6 checks passed
@EngincanV EngincanV deleted the fix/abp-ajax-form-check-default-prevented branch April 15, 2026 09:18
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

Successfully merging this pull request may close these issues.

3 participants