body-scroll-lock
body-scroll-lock copied to clipboard
fix: added missing CSS unit when positioning the window offset to `top`
Description
This PR simply adds the missing px
unit to the calculation of how much to offset from top
. Without this, certain browsers will simply interpret the value as 0
which makes the page scroll to the top.
On mobile iOS it does not attach top property on body element. This causes the scroll is not returned back to its previous position after scroll is enabled.