Bug 153224 - Tapping into an <input> within a position:fixed element scrolls to the top of the page
Summary: Tapping into an <input> within a position:fixed element scrolls to the top of...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari 9
Hardware: iPhone / iPad iOS 10
: P2 Normal
Assignee: Nobody
URL: http://output.jsbin.com/qicigu/1
Keywords: HasReduction, InRadar
Depends on:
Blocks: 159753
  Show dependency treegraph
 
Reported: 2016-01-18 23:13 PST by Chris Rebert
Modified: 2022-04-28 18:31 PDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Rebert 2016-01-18 23:13:51 PST
iOS version: 9.2
Testcase: http://output.jsbin.com/qicigu/1
Original Bootstrap bug report: https://github.com/twbs/bootstrap/issues/17497

Steps to reproduce:
1. Open http://output.jsbin.com/qicigu/1 in iOS Safari.
2. Scroll to the bottom of the page.
3. Tap the "Open modal" button.
4. A yellow overlay appears.
5. Tap on the <input> that has the text "Click here".

Actual result:
The page scrolls to the top, the input becomes focused, and the on-screen keyboard appears.

Expected result:
The input should become focused and the on-screen keyboard should appear.
The scroll position of the page should not change.
Comment 1 Chris Rebert 2016-01-18 23:16:22 PST
No such scrolling occurs in Android Chrome or OS X Safari.
Comment 2 Chris Rebert 2016-01-19 00:23:13 PST
<rdar://problem/24235301>
Comment 3 Chris Rebert 2016-01-22 01:20:02 PST
<rdar://problem/19708696>
Comment 4 Chris DeMars 2016-02-10 06:36:33 PST
After you fill out the input and hit done the focus shifts to the background, modal stays up, and the background scrolls.
Comment 5 Simon Fraser (smfr) 2022-02-08 20:32:19 PST
(very belatedly) fixed by https://trac.webkit.org/changeset/209867/webkit?
Comment 6 Nanjie Chen 2022-04-28 18:21:59 PDT
seems that the test case bug still presents as of now 

iOS version: 15.4.1
Comment 7 Nanjie Chen 2022-04-28 18:31:31 PDT
additional info with the bug still reproducible: 

Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1