Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#16202 closed defect (fixed)

[regression] Unexpected scrolling when typing in keyboard on ios6

Reported by: denwri Owned by: Eric Durocher
Priority: undecided Milestone: 1.8.2
Component: DojoX Mobile Version: 1.8.1
Keywords: ios6 Cc:
Blocked By: Blocking:

Description

Where there is an input dialog, standard behaviour is for the keyboard to push the dialog up when you focus on the input field.

However since upgrading to ios6, after each keyboard event the window is re-scrolling so that the view is repositioned at the top of the screen, pushing the dialog back down again even though the keyboard is still displayed.

Depending on the screen/dialog size this may cause the dialog to drop behind the keyboard.

This behaviour can be shown in the mobile showcase > Dialogs > Login Dialog

When you click in the ID or Password field to start typing the keyboard is displayed and the dialog is pushed up to accommodate the keyboard.

However as you type the scroll is reversed and dialog drops back down.

This is most problematic on the iphone as due to the smaller screen size the dialog is now hidden under the keyboard.

Attachments (2)

patch16202.patch (2.2 KB) - added by Adrian Vasiliu 6 years ago.
On iOS6, avoid reacting on resize events shortly after key events - Adrian Vasiliu, IBM, CCLA
patch16202-v2.patch (3.4 KB) - added by Adrian Vasiliu 6 years ago.
On iOS6, avoid reacting on resize events shortly after key events, and do not trigger address bar hiding if the virtual keyboard may be shown - Adrian Vasiliu, IBM, CCLA

Download all attachments as: .zip

Change History (11)

comment:1 Changed 7 years ago by Adrian Vasiliu

Thanks for catching it. This is a sad side-effect of my recent change for supporting the full-screen mode introduced in iOS6 (#16066). I'm sorry that I didn't catch it in my own testing.

It goes like that: prior to ios6, there wasn't any resize event when showing or hiding the virtual keyboard, nor when entering text. In iOS6, showing the keyboard still does not trigger a resize event, but, surprisingly, entering a character does it! Since we now listen (on iOS6 only) to resize events to be able to adjust the view when entering/exiting the full-screen mode, we inappropriately resize the view at that time point, which leads to the undesired scrolling.

The fact that typing characters triggers resize events is likely to be yet another iOS6 bug... (although so far I didn't find complaints against it; we'll complain on our own). Might go away at a future iOS6 update, but in the meantime we need a solution on our side. Given the lack of specific events for either the keyboard show/hide or the full-screen mode, we'll search for a trick to allow keeping the full-screen support while avoiding this side-effect. (We currently rely on thresholds for the amount of change for the width and height to filter the cases when the view needs to be resized, but testing the situations with the keyboard shows amounts of height change which vary a lot from a situation to another, including values similar to what we get with the full-screen mode thus it is difficult to distinguish between the two situations...). If nothing does the trick for both, maybe we'll need to make the full-screen support disabled by default, since I think the side-effect is worse than the benefit. Anyway, we'll work on it ASAP.

comment:2 Changed 7 years ago by cjolif

Keywords: ios6 added
Milestone: tbd1.8.2
Summary: Unexpected scrolling when typing in keyboard on ios6[regression] Unexpected scrolling when typing in keyboard on ios6

Changed 6 years ago by Adrian Vasiliu

Attachment: patch16202.patch added

On iOS6, avoid reacting on resize events shortly after key events - Adrian Vasiliu, IBM, CCLA

comment:3 Changed 6 years ago by Adrian Vasiliu

The attached patch is an attempt to circumvent the issue. More testing is ongoing.

comment:4 Changed 6 years ago by Adrian Vasiliu

Have been testing in a variety of situations and did not encounter problems on iPhone 4S iOS 6.

The only trouble I found is in mobileGallery - here, the unexpected scrolling when typing goes away like a charm, but it does not adapt its size when entering or exiting the full-screen mode. After investigation, this appears to be due to specific issues in this demo code (only for iphone, the demo hardcodes the size). This is unrelated with the changes in dojox/mobile/common for the full-screen support, and will be handled separately as a pure mobileGallery issue.

Update: upon further testing, I've found a more complex scenario (harder to reproduce) which still produces unexpected scrolling. Investigation ongoing...

Last edited 6 years ago by Adrian Vasiliu (previous) (diff)

comment:5 Changed 6 years ago by Adrian Vasiliu

The other case that wasn't covered by the initial patch concerns apps configured to hide the address bar; iOS6 appears to also fire a resize event when switching the focus back and forth between an input field and another (the virtual keyboard being shown), not only just after touching a key (as in the original "how to reproduce"). And the address bar hiding hurts here, because it resets the browser scroll.

The attached patch16202-v2.patch replaces the first version of the patch and addresses both cases, that is it preserves as much as possible the address bar hiding when entering/exiting the full-screen mode while avoiding interfering with the browser scroll during the editing of input fields. Further testing and validation will follow.

Last edited 6 years ago by Adrian Vasiliu (previous) (diff)

Changed 6 years ago by Adrian Vasiliu

Attachment: patch16202-v2.patch added

On iOS6, avoid reacting on resize events shortly after key events, and do not trigger address bar hiding if the virtual keyboard may be shown - Adrian Vasiliu, IBM, CCLA

comment:6 Changed 6 years ago by cjolif

Resolution: fixed
Status: newclosed

In [29867]:

fixes #16199, #16202. Fixes remaining iOS6 issues including one regression. Thanks Adrian Vasiliu (IBM, CCLA). !strict

comment:12 Changed 6 years ago by cjolif

In [29868]:

fixes #16199, #16202. Fixes remaining iOS6 issues including one regression (backport to 1.8). Thanks Adrian Vasiliu (IBM, CCLA). !strict

comment:13 Changed 6 years ago by Adrian Vasiliu

iOS 6.0.1 is now out, and at a quick testing it appears the fix on our side is still useful (and still works).

Last edited 6 years ago by Adrian Vasiliu (previous) (diff)

comment:14 Changed 6 years ago by Adrian Vasiliu

The same holds for Safari included in iOS 6.1 beta (tested using the simulator).

Note: See TracTickets for help on using tickets.