Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#16361 closed defect (fixed)

dojox/mobile: on iOS6, unexpected scrolling when editing text fields located inside a ScrollableView

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

Description

When running on iOS6 or later, unexpected scrolling occurs while editing text fields that are descendants of a ScrollableView. The unwanted scrolling occurs when going from one text field to another by pressing NEXT or PREV on the soft keyboard.

How to reproduce:

  1. Load the attached test_Textbox-in-ScrollableView.html (place it dojox/mobile/tests) on a iOS6 or later device or simulator.
  2. Scroll till the text boxes in the middle of the scrollable view are visible.
  3. Touch a text box => The soft keyboard is now visible.
  4. Press NEXT to navigate from a text box to the next one.

==> An unwanted scroll occurs.

Attachments (3)

test_TextBox-in-ScrollableView.html (19.9 KB) - added by Adrian Vasiliu 7 years ago.
Test case for reproducing the bug.
patch16361.patch (2.0 KB) - added by Adrian Vasiliu 7 years ago.
Do not react on resize events fired while a form element is active (to avoid unwanted scroll) - Adrian Vasiliu, IBM, CCLA
test_next-until-end.html (2.6 KB) - added by leopatras 7 years ago.

Download all attachments as: .zip

Change History (13)

Changed 7 years ago by Adrian Vasiliu

Test case for reproducing the bug.

comment:1 Changed 7 years ago by Adrian Vasiliu

This issue is close to the unwanted scroll described (and fixed) in #16202. The difference is that, here, the text fields are located in a ScrollableView. The fix in #16202 has avoided that dojox/mobile/common possibly triggers a browser scroll by its hide address bar mechanism. Instead, it just calls dojox/mobile/common.resizeAll.

So far so good, but _ScrollableMixin, since the fix of #14991, listens to the "dojox/mobile/afterResizeAll" topic and, if the active element is form element and is a descendant of a scrollable mixin, triggers scroll to bring it into the view... Hence the unwanted scroll in such a use-case.

The attached candidate fix avoids that dojox/mobile/common reacts to resize events if the active element is a form element. Note that this preserves the correct adjusting of the size when entering/exiting the full-screen mode: when a form element is active, the soft keyboard is shown hence it hides the full-screen toggle button. Hence, the only situation when the user can enter/exist the full-screen is when the form element is not active. (To be on the safe side, this new check is done in addition to the checks already done as fix of #16202).

Changed 7 years ago by Adrian Vasiliu

Attachment: patch16361.patch added

Do not react on resize events fired while a form element is active (to avoid unwanted scroll) - Adrian Vasiliu, IBM, CCLA

comment:2 Changed 7 years ago by cjolif

Milestone: tbd1.8.2

comment:3 Changed 7 years ago by cjolif

In [30077]:

refs #16361. Do not react on resize events fired while a form element is active (to avoid unwanted scroll) + testcase. Thanks Adrian Vasiliu, IBM, CCLA. !strict.

comment:4 Changed 7 years ago by cjolif

Resolution: fixed
Status: newclosed

In [30078]:

fixes #16361. Do not react on resize events fired while a form element is active (to avoid unwanted scroll). Thanks Adrian Vasiliu, IBM, CCLA. !strict.

comment:5 in reply to:  description Changed 7 years ago by leopatras

Replying to Adrian:

When running on iOS6 or later, unexpected scrolling occurs while editing text fields that are descendants of a ScrollableView. The unwanted scrolling occurs when going from one text field to another by pressing NEXT or PREV on the soft keyboard.

How to reproduce:

  1. Load the attached test_Textbox-in-ScrollableView.html (place it dojox/mobile/tests) on a iOS6 or later device or simulator.
  2. Scroll till the text boxes in the middle of the scrollable view are visible.
  3. Touch a text box => The soft keyboard is now visible.
  4. Press NEXT to navigate from a text box to the next one.

==> An unwanted scroll occurs.

The patch from Adrian does not completely cover the problem. During using the "Next" soft key there seem to occur still an unwanted scroll which confuses ScrollableView?'s own machinery. How to reproduce:

  1. Attached html file "test_next-until-end.html" raises the issue (place it in dojox/mobile/tests) on a IOS6 or later device or simulator and run it against the dojo trunk (checked out 12/03/2012, rev 30118)
  2. Follow the instructions on the screen

Changed 7 years ago by leopatras

Attachment: test_next-until-end.html added

comment:6 Changed 7 years ago by dylan

Resolution: fixed
Status: closedreopened

comment:7 Changed 7 years ago by Adrian Vasiliu

@leopatras, From your description, it looks like a perfect duplicate of #16363. I'm unable to test it myself till next Monday, but from your wording here and inside the test case you attached, it looks similar.

This other issue is not specific to iOS6 and is not a recent regression. As you can see in #16363, a patch is attached for this other issue, but this is not yet committed because there is hope to find a better fix. In the meantime, if you could give this patch a try on your side it would be helpful as an additional testing.

@dylan, I would think you can close this ticket again.

comment:8 Changed 7 years ago by dylan

Resolution: fixed
Status: reopenedclosed

comment:9 Changed 7 years ago by leopatras

My apologies, I didn't see that the 16363 patch was not in the trunk. I applied the patch16363.patch and now the test is working. Sorry for causing unnecessary work.

comment:10 in reply to:  9 Changed 7 years ago by Adrian Vasiliu

No problem, thanks for having tested the patch.

Note: See TracTickets for help on using tickets.