I have layout that has button sticked to bottom of the screen. Currently it's done with flexbox (content is flex 1 and button has fixed height).
The problem is with mobile browsers, I have used dvh for outer container, that way it sticks to bottom even with browser bar.
On Android chrome the bar hides on scrolling (even though there is no scroll on the page ), viewport changes dimensions, and button jumps to the bottom. I want to smooth this transition, and have no idea how to approach animating such movement.
(Tips on other ways to solve this problem also welcome)
To make sure things move smoothly when you scroll or change the size of your screen, like when those bars pop up or disappear on your phone, you can use a mix of CSS transitions and JavaScript. This Code should solve the problem.
HTML:
CSS:
JavaScript (necessary for mobile):