Skip to content

Commit

Permalink
fix(core/icon-button): dispatch form submit event
Browse files Browse the repository at this point in the history
  • Loading branch information
danielleroux committed Jun 16, 2023
1 parent 4dc776a commit 3e91ecf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/core/src/components/icon-button/icon-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ export class IconButton implements Button {
dispatchFormEvents() {
if (this.type === 'submit') {
const form = this.hostElement.closest('form');

if (form) {
form.dispatchEvent(new Event('submit'));
}
form?.dispatchEvent(
new Event('submit', { bubbles: true, cancelable: true })
);
}
}

Expand Down

0 comments on commit 3e91ecf

Please sign in to comment.