Improve repostioning mistakes after scrolling logic

This commit is contained in:
Aljaž Grilc 2024-03-29 08:09:27 +01:00
parent c6424e801d
commit 780bc25da6

View File

@ -527,10 +527,9 @@ class BesService {
if (service.scrollTimeout) clearTimeout(service.scrollTimeout) if (service.scrollTimeout) clearTimeout(service.scrollTimeout)
service.scrollTimeout = setTimeout(() => { service.scrollTimeout = setTimeout(() => {
console.log('Scrolling stop')
service.repositionMistakes() service.repositionMistakes()
service.scrollTimeout = null service.scrollTimeout = null
}, 200) }, 500)
} }
/** /**
@ -1191,9 +1190,12 @@ window.onscroll = () => {
besServices.forEach(service => { besServices.forEach(service => {
service.scrollPanel.style.top = -service.hostElement.scrollTop + 'px' service.scrollPanel.style.top = -service.hostElement.scrollTop + 'px'
service.offsetTop = service.hostElement.scrollTop service.offsetTop = service.hostElement.scrollTop
// setTimeout(() => {
// service.repositionMistakes() if (service.windowScrollTimeout) clearTimeout(service.windowScrollTimeout)
// }, 100) service.windowScrollTimeout = setTimeout(() => {
service.repositionMistakes()
service.windowScrollTimeout = null
}, 300)
}) })
} }