question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: scroll assist needs improved keyboard estimation on web

See original GitHub issue

Prequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

On iOS Safari (and as an app with β€œAdd to Home Screen”), there is an uncomfortable pause when switching between inputs.

Expected Behavior

When tapping another input on the page to switch focus, there should be no delay when no scrolling is required and keyboard remains open.

Steps to Reproduce

  1. Open following app in Safari on iOS/iPadOS device or simulator:
  2. tap β€œAddress Line 1”
    • caret appears at the beginning of Address Line 1
    • keyboard shows up
  3. tap β€œAddress Line 2”
    • caret disappears from β€œAddress Line 1”
    • keyboard stays open
    • – awkward pause lasting about a second –
    • caret appears at the beginning of Address Line 2

reproducible on:

  • iPad Air 2 (iPadOS 14.6)
  • iPhone 12 mini (iOS 14.4; on Simulator)

Code Reproduction URL

https://github.com/ippeiukai/ionic-safari-input-issue-23664

Ionic Info

$ ionic info

Ionic:

   Ionic CLI                     : 5.4.16 (/β– β– β– β– β– β– β– /lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 5.6.11
   @angular-devkit/build-angular : 12.1.2
   @angular-devkit/schematics    : 12.1.2
   @angular/cli                  : 12.1.2
   @ionic/angular-toolkit        : 4.0.0

Capacitor:

   Capacitor CLI   : 3.1.1
   @capacitor/core : 3.1.1

Utility:

   cordova-res : not installed
   native-run  : 1.4.0

System:

   NodeJS : v12.22.3 (/β– β– β– β– β– β– β– /bin/node)
   npm    : 6.14.13
   OS     : macOS Catalina


  ────────────────────────────────────────────────────────────

          Ionic CLI update available: 5.4.16 β†’ 6.11.8
                                
     The package name has changed from ionic to @ionic/cli!
                                
             To update, run: npm uninstall -g ionic
                 Then run: npm i -g @ionic/cli

  ────────────────────────────────────────────────────────────

Additional Information

Observing the DOM with Web Inspector suggests the relocateInput hack is being executed when β€œAddress Line 2” is tapped, although there is no scrolling happening and the keyboard is already open and remains open. https://github.com/ionic-team/ionic-framework/blob/v5.6.11/core/src/utils/input-shims/hacks/common.ts#L14

Our production app (which uses @ionic/angular 5.3.3) is affected and one of the views has severely degraded user experience as a result. Any help or workaround would be greatly appreciated.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
liamdebeasicommented, Feb 28, 2022

The code that handles scroll assist is here: https://github.com/ionic-team/ionic-framework/blob/7315e0157b917d2e3586c64f8082026827812943/core/src/utils/input-shims/hacks/scroll-assist.ts

You can also disable scroll assist for now by setting scrollAssist: false in your Ionic config. This allows you to avoid this behavior while continuing to use ion-input.

3reactions
pgmoftexascommented, Mar 19, 2022

@corysmc Second this, β€œscrollAssist: false” fixes it. Despite any repercussions caused in iOS or Android builds. I refuse to β€œadd blank space at bottom of your ion-content”. Seems silly even if it works. This is not our fault and the failure of ionic dev team. Should be properly fixed truly. I refuse to hinder UX design at my own cost.

https://github.com/ionic-team/ionic-framework/issues/13414 The link above shows that this has been an issue since 2017. Of course, Ionitron Bot closed it, nothing new there. This is a problem with ionic dev team and they seem to have refused to provide a solid fix for it. If I am wrong and there is an actual fix besides this, please correct me @liamdebeasi or let me know. Just stating facts from what I have seen since 2017.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: scroll assist not positioning correctly Β· Issue #21688
While scroll-assist was recently improved to position inputs more precise it also introduces a problem when the keyboard height is correctedΒ ...
Read more >
Scrolling with ALPS touchpad is twice as fast as it should be
I estimate it to be double (so 6 lines) of what I set scrolling speed to be. The result is that scrolling is...
Read more >
Keyboard random repeat and dropped key presses
Bug Description. Hi all. I have a problem that my keyboard will seemingly at random start repeating itself or do nothing at all....
Read more >
Position fixed on chrome mobile causing element to move on ...
I'm facing this strange issue that looks like a bug on Chrome mobile. I have a div withΒ ...
Read more >
Easy Checks – A First Review of Web Accessibility - W3C
Text: Headings; Contrast ratio ("color contrast"); Resize Text. Interaction: Keyboard access and visual focus; Forms, labelsΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found