ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: Form submit event not triggered when ion-button has static `type="submit"` declaration

Open godenji opened this issue 1 year ago • 2 comments

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

This is related to #27952 , which was apparently fixed.

Here's a Stackblitz illustrating the issue: https://stackblitz.com/edit/angular-wrvuyk-3ubxef?file=src%2Fapp%2Fexample.component.html

Note that with <ion-button [type]="someVar">Save</ion-button> the form submits on button press as expected; however, with a static definition like so, <ion-button type="submit">Save</ion-button> the form is not submitted, nothing happens.

Expected Behavior

With static type="submit" form (submit) event is triggered

Steps to Reproduce

<form [formGroup]="form" (submit)="save()">
  <ion-button type="submit">Save</ion-button>
</form>

This may or may not be related to a form embedded in a modal, but since the vast majority of my use cases for forms are modal embedded the above Stackblitz demontrates the errant behavior.

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 7.1.1 (/home/me/.npm/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 7.6.2 @angular-devkit/build-angular : 17.0.7 @angular-devkit/schematics : 17.0.7 @angular/cli : 17.0.7 @ionic/angular-toolkit : 10.0.0

Capacitor:

Capacitor CLI : 5.6.0 @capacitor/android : not installed @capacitor/core : 5.6.0 @capacitor/ios : not installed

Cordova:

Cordova CLI : 10.0.0 Cordova Platforms : not available Cordova Plugins : not available

Utility:

cordova-res : not installed globally native-run : 2.0.0

System:

NodeJS : v20.10.0 (/usr/bin/node-20) npm : 10.2.3 OS : Linux 6.5

Additional Information

No response

godenji avatar Dec 30 '23 03:12 godenji

Thanks for the issue! This issue has been labeled as holiday triage. With the winter holidays quickly approaching, much of the Ionic Team will soon be taking time off. During this time, issue triaging and PR review will be delayed until the team begins to return. After this period, we will work to ensure that all new issues are properly triaged and that new PRs are reviewed. In the meantime, please read our Winter Holiday Triage Guide for information on how to ensure that your issue is triaged correctly. Thank you!

ionitron-bot[bot] avatar Dec 30 '23 03:12 ionitron-bot[bot]

Hello @godenji thanks for reporting this issue.

Can you provide which browser and browser version you are testing against? I'm unable to reproduce with Google Chrome Version 120.0.6099.129 & Safari Version 17.2.1. Both cases log "test" when pressing the submit button.

I also tested with your code sample, since the reproduction is different, but was unable to reproduce.

Thanks!

sean-perkins avatar Jan 02 '24 19:01 sean-perkins

Thanks for the issue! This issue is being closed due to the lack of a reply. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Thank you for using Ionic!

ionitron-bot[bot] avatar Jan 16 '24 20:01 ionitron-bot[bot]