Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4: ion-button does not trigger reactive form ngSubmit #14776

Closed
matthew-valenti opened this issue Jul 15, 2018 · 1 comment

Comments

@matthew-valenti
Copy link

commented Jul 15, 2018

Bug Report

Ionic Info

Ionic:

   ionic (Ionic CLI)          : 4.0.0-rc.11 (C:\Users\matth\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework            : @ionic/angular 4.0.0-alpha.9
   @angular-devkit/core       : 0.7.0-rc.1
   @angular-devkit/schematics : 0.7.0-rc.1
   @angular/cli               : 6.0.8
   @ionic/ng-toolkit          : 1.0.0-rc.10
   @ionic/schematics-angular  : 1.0.0-rc.10

System:

   NodeJS : v8.9.4 (C:\Program Files\nodejs\node.exe)
   npm    : 5.6.0
   OS     : Windows 10

Describe the Bug
<ion-button type="submit" does not trigger form ngSubmit. <button type="submit" does trigger this event.

Steps to Reproduce
Steps to reproduce the behavior:

  1. Create a simply Angular Reactive Form
  2. Add <ion-button type="submit"
  3. Click button
  4. ngSubmit event on <form does not trigger

Related Code

<form [formGroup]="form" (ngSubmit)="submit($event)">
	<ion-item>
		<ion-label position="floating">Email</ion-label>
		<ion-input formControlName="email" type="email"></ion-input>
	</ion-item>
	<ion-item *ngIf="!form.controls.email.valid" class="validation-message">
		<p>Enter a valid email.</p>
	</ion-item>
	<ion-button type="submit">Submit</ion-button>
</form>
ngOnInit() {
	this.form = this.formBuilder.group({
		password: ['', Validators.compose([Validators.required, Validators.maxLength(8), Validators.maxLength(64)])],
	});
}

Expected Behavior
Clicking <ion-button type="submit" triggers ngSubmit event on form.

@ionitron-bot ionitron-bot bot added the triage label Jul 15, 2018

@matthew-valenti matthew-valenti changed the title ion-button does not trigger reactive form ngSubmit v4: ion-button does not trigger reactive form ngSubmit Jul 15, 2018

@adamdbradley adamdbradley added events and removed triage labels Jul 16, 2018

@adamdbradley adamdbradley self-assigned this Jul 16, 2018

@adamdbradley adamdbradley added this to Backlog 🤖 in Ionic Core via automation Jul 16, 2018

@adamdbradley adamdbradley moved this from Backlog 🤖 to In progress 🤺 in Ionic Core Jul 16, 2018

Ionic Core automation moved this from In progress 🤺 to Done 🎉 Jul 16, 2018

@brandyscarney brandyscarney removed this from Done 🎉 in Ionic Core Jul 30, 2018

@ionitron-bot

This comment has been minimized.

Copy link

commented Sep 1, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. 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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 1, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.