One issue that arises when using percentage or viewport unit width and height for the <body>
element is that the size of these elements will change when a mobile keyboard is invoked due to an input.
I have extensively researched this problem without finding a satisfactory solution.
One suggestion I came across was adjusting the layout to accommodate the new viewport size: mobile viewport resize due to keyboard
However, this solution may not be very practical.
Is there anyone who knows how to manipulate the mobile keyboard on the web?
After conducting some tests, I discovered a workaround which I will share in the responses. If there are better methods out there, please let me know :)