79183723

Date: 2024-11-13 07:05:10
Score: 5.5
Natty:
Report link

I faced an issue which is, i have an ios app (flutter) and it renders the the website inside the app as in app web view, now the issue was the page has 4 input fields and height for the form is set to auto, and html, body set to 100%, when clicking on the input field for the first time and keyboard appears nothing changed on the layout works fine. But, clicking on the other input fields, the total page is shrinked down behind the keyboard, and the window.offsetTop & window.pageTop value becomes in negative, not 0, after closing the keyboard those values changed to 0 again, the page comes to the top again, but again clicking on inputs the behaviour continued..

Now what i did was to stop the page get shrinked down behind the keyboard, im listening for the scroll and resize events and checks for the offsetTop and pageTop value that is less than 0, then i set the

window.scrollTo({top:0, behaviour :smooth})

by handling like this the page is coming back to its default pos even if the values are in negative,

but the con is, the window.scrollTo() is a manual scrolling, so the page shows a slight jump effect (scrolling to the top).

Does anyone know a solution for this or faced this scenario, help me out...

or is this jump effect is fine for in app web view, share your opinions about this.

Reasons:
  • Blacklisted phrase (1): help me
  • RegEx Blacklisted phrase (2): Does anyone know
  • RegEx Blacklisted phrase (2): help me out
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Rajeshkanth