iOS Safari scroll position jump
See original GitHub issueThis one took a while to track down!
A combination of:
- Viewport tag:
<meta name="viewport" content="width=device-width, initial-scale=1">
- Page content height being less than the viewport height
Results in the scroll position jumping position on each keypress within the textarea.
Reproduction app: https://github.com/dburles/react-autosize-textarea-issue
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Safari jumps to the top of the previous page
When I am using Safari (iPhone iOS 15.4) any time I hit the back button, it brings me to the top of the...
Read more >Mobile Safari: JS event for jump to last scroll position on refresh
Is there a Javascript event that I can hook into that fires when the page is refreshed, and Safari 'jumps' back to the...
Read more >Change to position fixed on iOS Safari while scrolling
Element will usually flicker, and disappear until scrolling has stopped completely. Just force GPU acceleration by adding transform: translate3d(0,0,0); to ...
Read more >How To Prevent Scrolling The Page On iOS Safari 15 - PQINA
If you're browsing this page on iOS Safari, scroll up and down a bit to see the height stays fixed no matter of...
Read more >iOS 15 Beta 5 - Safari doesn't remember scroll position on ...
This has been a bug with iOS for years. It does it with all browsers. One of the biggest frustrating things iOS has...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not sure if it’s the same problem but this morning I found out there is an issue in ios 11 related to autosize. It’s not going to be fixed, they said it’s an ios bug and the solution is to exclude the autosize > For Autosize, I think the best thing to do is to exclude it for iOS users. (not a very good solution)
You can reproduce the issue changing the content of the last textarea of the page with an iphone with ios 11 http://react-components.buildo.io/#textareaautosize
More info here: https://github.com/jackmoore/autosize/issues/343 https://github.com/jackmoore/autosize/pull/352
I temporary switch to another library that seems to work better at least for me: https://github.com/andreypopp/react-textarea-autosize
@FrancescoCioria I’m was on an iPhone 6s on iOS 11.
Actually, you have to be scrolled past the textarea. You should see the scroll position jump bringing it into focus. It’s definitely not a behavior of Safari as removing
onChange
andvalue
results in the expected behavior.