useScrollLock: Compensate for scrollbar with padding
mrleblanc101 opened this issue · comments
Sébastien LeBlanc commented
Clear and concise description of the problem
Currently, locking the window scroll move the page content because the viewport becomes larger.
Suggested solution
Add an option to compensate by adding padding to the element (html/body) like other popular packages: https://www.npmjs.com/package/body-scroll-lock#reservescrollbargap
Alternative
Wrap this in a composable that does it manually
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Sébastien LeBlanc commented
Other alternative, use https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-gutter
But it is not supported in Safari yet, and even when it land it won't solve the problem for anyone that has not updated