Open
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v8.x
Current Behavior
When you click on an ion-input with attribute (click)="function", this function is called twice when you click on the label within that ion-input. When you click on the value it is called once (as it should).
Expected Behavior
That the function would only be called once when you click on the label within the ion-input
Steps to Reproduce
- Recent ionic & angular
- Example:
<ion-list>
<ion-item>
<ion-input label="Input with value" value="121 S Pinckney St #300" (click)="clicked()"></ion-input>
</ion-item>
<ion-item>
<ion-input labelPlacement="floating" label="Input with value" value="121 S Pinckney St #300" (click)="clicked()"></ion-input>
</ion-item>
</ion-list>
- Clicking on the label within the ion-input calls the function clicked() twice.
Code Reproduction URL
https://stackblitz.com/edit/ubs56gug?file=src%2Fapp%2Fexample.component.html
Ionic Info
Its ionic from the current stackblitz config used in the docs, from package.json:
"@angular/animations": "^19.0.0",
"@angular/common": "^19.0.0",
"@angular/compiler": "^19.0.0",
"@angular/core": "^19.0.0",
"@angular/forms": "^19.0.0",
"@angular/platform-browser": "^19.0.0",
"@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0",
"@ionic/angular": "^8.0.0",
"@ionic/core": "^8.0.0",
"ionicons": "7.4.0",
"rxjs": "^7.8.1",
"tslib": "^2.5.0",
"zone.js": "~0.15.0"
Additional Information
Adding event.preventDefault(); can be used as a dirty fix untill this issue gets resolved.