ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.93k stars 13.52k forks source link

bug: ion-item with ion-input firing 2 click events on iPhoneX #29051

Closed cconti1 closed 7 months ago

cconti1 commented 7 months ago

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

I have an ion-item with inside an ion-label and an ion-input.

The ion-item has the button property how described in https://ionicframework.com/docs/api/item#clickable-items to handle out custom logic when the user clicks anywhere on the ion-item.

When emulating the app on iPhone and the ion-item is set to a specific area of the screen, clicking on the ion-item fires 2 click events instead on 1. This doesn't happen if the ion-item is moved to a different position in the screen, although it doesn't seem there is any obvious explanation for this behaviour.

The issue has been reproduced in a brand new app with just the ion-item in it. https://stackblitz.com/~/github.com/Cris13/double-click-ionic-issue

The second click that is generated is defined as untrusted and doesn't have a pointerType.

Reproducible only on iOS devices.

Expected Behavior

Only one click event should be triggered when clicking anywhere on the ion-item

Steps to Reproduce

  1. Open the example app in iPhoneX emulator https://stackblitz.com/~/github.com/Cris13/double-click-ionic-issue
  2. Open the console
  3. Click on the ion-item with label "Button Item"
  4. Observe 2 click events are reported in the console log, the first one is the correct one generated by the user interaction, the second one is untrested and seems generated by some ionic internal logic
Screenshot 2024-02-14 at 10 34 08 AM

Code Reproduction URL

https://github.com/Cris13/double-click-ionic-issue

Ionic Info

Ionic:

Ionic CLI : 5.4.16 (/Users/cristianaconti/.npm/_npx/864a9e3c2cd0cf50/node_modules/ionic) Ionic Framework : not installed @angular-devkit/build-angular : 17.1.3 @angular-devkit/schematics : 17.1.3 @angular/cli : 17.1.3 @ionic/angular-toolkit : 9.0.0

Utility:

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

System:

NodeJS : v18.19.0 (/Users/cristianaconti/.nvm/versions/node/v18.19.0/bin/node) npm : 10.2.3 OS : macOS Unknown

Additional Information

No response

liamdebeasi commented 7 months ago

Thanks for the issue. I am going to close this as a duplicate of https://github.com/ionic-team/ionic-framework/issues/25200.

edit: Apologies, I linked to the wrong issue. The correct issue is now linked.

ionitron-bot[bot] commented 6 months ago

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.