Skip to content

Commit

Permalink
form-data-event: Don't close a modal within the submit handler. This …
Browse files Browse the repository at this point in the history
…should only be done via pat-modal's .close-panel CSS class handler.
  • Loading branch information
thet committed Sep 8, 2021
1 parent c90651a commit 8ad3bbe
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/core/form-data-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ parser.attribute = "data-form-data-event"; // do not require ``data-pat-``
parser.addArgument("event-name-submit");
parser.addArgument("event-name-init");
parser.addArgument("prevent-submit", true);
parser.addArgument("close-modal", true);

export default Base.extend({
name: "form-data-event",
Expand Down Expand Up @@ -46,12 +45,6 @@ export default Base.extend({
detail: { form_data: form_data },
});
document.dispatchEvent(ev);
if (this.options.closeModal) {
const modal = this.el.closest(".pat-modal");
if (modal) {
modal["pattern-modal"].destroy();
}
}
if (this.options.event["name-init"]) {
document.removeEventListener(
this.options.event["name-init"],
Expand Down

0 comments on commit 8ad3bbe

Please sign in to comment.