mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: race condition where navigator.update was called when it should not be
This commit is contained in:
@@ -581,9 +581,9 @@ define('navigator', ['forum/pagination', 'components', 'hooks', 'alerts'], funct
|
||||
function animateScroll() {
|
||||
function reenableScroll() {
|
||||
// Re-enable onScroll behaviour
|
||||
setTimeout(() => { // fixes race condition from jQuery — onAnimateComplete called too quickly
|
||||
$(window).on('scroll', navigator.delayedUpdate);
|
||||
const scrollToRect = scrollTo.get(0).getBoundingClientRect();
|
||||
navigator.update(scrollToRect.top);
|
||||
}, 50);
|
||||
}
|
||||
function onAnimateComplete() {
|
||||
if (done) {
|
||||
|
||||
Reference in New Issue
Block a user