0

When changing focus between inputs , scroll occurs

How can I prevent this scrolling on focus?

Actually, having tried all the methods that I could find: Preventing an <input> element from scrolling the screen on iPhone?

None of the proposed methods worked on IOS 15

  • Scolling happens to keep the input, that is active, visible. What reason do you have to not want this? – KIKO Software Nov 26 '22 at 09:12
  • Could you describe in detail what you want it to look like when a user focuses on an input. If there is no scrolling there is of course the danger that the on screen keyboard will cover the desired input. Are you wanting to decide exactly where to scroll to yourself? If so how will you deal with the keyboard? – A Haworth Nov 26 '22 at 09:47
  • Please provide enough code so others can better understand or reproduce the problem. – Community Nov 26 '22 at 19:49

1 Answers1

0

I had a similar issue and I found a solution while googling. You can try the following CSS code that worked for me:

html,body{
    -webkit-overflow-scrolling : touch !important;
    overflow: auto !important;
}

Original Credit to: https://stackoverflow.com/a/35675094/1625130

Dori Rina
  • 364
  • 2
  • 7