How to calculate scrollbar width before elements are visible ?
Hi everyone,
I am trying to determine the user's scrollbar width by calculating
window.innerWidth - document.body.clientWidth
. However, when I use the app:beforeMount
hook, this code executes after the DOM has been rendered and the first elements are already visible. Is there a way to execute this calculation before any elements become visible?
Thank you!2 Replies
i do know that if you need the scrollbar not to affect the layout, look into the new css property
scrollbar-gutter: stable
@SpiKe.