refactor: use scrollTop instead of scrollTo

This commit is contained in:
Timothy Z. 2024-08-27 14:23:40 +03:00
parent 48e44a0332
commit 011ecd21ca

View file

@ -19,8 +19,8 @@ const NavTabButton = ({ className, logo, icon, label, href, selected, onClick })
const scrollableElements = document.querySelectorAll('div');
scrollableElements.forEach((element) => {
if (element.scrollHeight > element.clientHeight) {
element.scrollTo(0, 0);
if (element.scrollTop > 0) {
element.scrollTop = 0;
}
});
};