-
Notifications
You must be signed in to change notification settings - Fork 13.5k
bug: scroll assist causes duplicate click and focus events to be fired #25200
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
Comments
Thanks for the issue. Which browser/version are you testing this on? |
On Chrome - Version 100.0.4896.127 (Official Build) (x86_64) |
Did you push your complete reproduction to the linked repo? I only see a blank starter application. |
No I didn't. I am so sorry. Now I have pushed it. Simple code in HomePage.vue. ONE IMPORTANT NOTE. Just noticed it. When the inspector is open in Chrome, toggle the device toolbar and select an iPhone. (I used iPhone12). If the behavior does not show at first, reload the page (which will present the iPhone identity to Ionic). |
Thanks, I can reproduce this behavior. This problem is related to our scroll assist utility. The scroll assist utility ensures that inputs are not covered by the keyboard when the keyboard opens. It works by cloning the input and temporarily moving the original input offscreen while the content scrolls the input into the correct place. This is done by setting ionic-framework/core/src/utils/input-shims/hacks/common.ts Lines 49 to 50 in 780f16d
Unfortunately, this causes the browser to blur the input. As a result, we manually call This results in the duplicate focus and additional blur events you are seeing. |
@liamdebeasi i'm in v8 and experiencing same problem, is there a solution for that ? |
Hi there, I do not work for Ionic anymore, so I won't be much help in getting this resolved. Sorry about that! |
Prerequisites
Ionic Framework Version
Current Behavior
When ion-input and ion-item gains focus, an ionBlur event is fired incorrectly.
Expected Behavior
Steps to Reproduce
Code Reproduction URL
https://github.com/KWIPPED/ionic-event-bug
Ionic Info
Ionic:
Ionic CLI : 6.19.0 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 6.1.2
Capacitor:
Capacitor CLI : 3.5.0
@capacitor/android : not installed
@capacitor/core : 3.5.0
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 1.5.0
System:
NodeJS : v14.16.0 (/usr/local/bin/node)
npm : 6.14.11
OS : macOS Monterey
Additional Information
No response
The text was updated successfully, but these errors were encountered: