bug: scroll assist cancels first click event
See original GitHub issueBug Report
Ionic version: [ ] 4.x [x] 5.x
Current behavior:
An ion-item
in a ion-list
needs two clicks/taps to trigger the click event. This only happens on iOS (Safari/WebKit).
Expected behavior: The event should trigger on the first click.
Steps to reproduce:
- Create an
ion-list
- Within the
ion-list
create anion-item
with a(click)
event handler - Within the
ion-item
create anion-label
- Within the
ion-item
create anion-input
- Within the
ion-item
create anion-button
Related code:
This is the markup with which you can reproduce the issue. You can also find a GIF at the bottom of this issue.
<ion-list>
<ion-item (click)="onTitleClicked()" button detail="false">
<ion-label position="floating">
Title
</ion-label>
<ion-input [value]="title" readonly></ion-input>
<ion-button
*ngIf="title"
slot="end"
fill="clear"
size="small"
(click)="resetTitle($event)"
>
<ion-icon name="close"></ion-icon>
</ion-button>
</ion-item>
</ion-list>
I tried to narrow it down to the following, but the issue still persists.
<ion-list>
<ion-item (click)="onTitleClicked()" button detail="false">
<ion-label>
Title
</ion-label>
<ion-input [value]="title"></ion-input>
</ion-item>
</ion-list>
You can find a sample application on my GitHub.
Other information:
I found out that this change of behaviour was introduced with version v5.0.6
. I’ve checked the changes between the versions v5.0.5
and v5.0.6
but I didn’t find any suspicious code 🤔
Ionic info:
Ionic:
Ionic CLI : 6.11.0 (/Users/phil/.asdf/installs/nodejs/12.17.0/.npm/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.3.1
@angular-devkit/build-angular : 0.901.12
@angular-devkit/schematics : 9.1.12
@angular/cli : 9.1.12
@ionic/angular-toolkit : 2.3.0
Capacitor:
Capacitor CLI : 2.4.0
@capacitor/core : 2.4.0
Utility:
cordova-res : not installed
native-run : 1.0.0
System:
NodeJS : v12.17.0 (/Users/phil/.asdf/installs/nodejs/12.17.0/bin/node)
npm : 6.14.4
OS : macOS Catalina
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:23 (7 by maintainers)
Top Results From Across the Web
browser page unexpectedly scrolls to topmost position after ...
This has the effect of the browser scrolling back up to the top of the page (because it looks for something with a...
Read more >126500 - Button click event not fired when dragging mouse ...
This seems to be causing some mouse clicks to not be triggered. The reason being is that the mouse is often moving when...
Read more >Solved: Bug? Odd behavior with automatically moving view
When I click on the first 11 that are listed in the OOB "SC Categories" widget, the page snaps back to ... I...
Read more >Mouse scrolling stops working in m… | Apple Developer Forums
Since that upgrade my Apple mouse sometimes stops scrolling. ... I can move the cursor and click other than that all other magic...
Read more >[Cocoa] MouseWheel events cannot be canceled with Table ...
The problem is that SWT, in Control.scrollWheel(), only calls the event handlers if deltaY is non-zero. Thus, with slow scrolling, the event handlers...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Glad the issue is resolved. I merged in https://github.com/ionic-team/ionic-framework/pull/22845, the fix for this issue. This fix will be available in the next release of Ionic Framework.
Thanks!
@liamdebeasi Thank you so much 🎉 I just tried it out and it works like a charm 😍 I tested it in our production app and in my demo repo. Finally, the issue seems to be resolved. I run some tests on an iPhone 8, iPhone 12 Pro and also on an Android device and everything works as expected.
Should I run some additional testing or can I support you in some other way? Please let me know.