🐛(frontend) remove scroll listener table content
During a useEffect cleaning, the selector was not the correct one. The debounce was not being removed correctly neither.
This commit is contained in:
@@ -8,6 +8,11 @@ and this project adheres to
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
- 🐛(frontend) remove scroll listener table content #688
|
||||||
|
- 🔒️(back) restrict access to favorite_list endpoint #690
|
||||||
|
|
||||||
|
|
||||||
## [2.4.0] - 2025-03-06
|
## [2.4.0] - 2025-03-06
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
@@ -21,7 +26,7 @@ and this project adheres to
|
|||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
- 🐛(frontend) fix collaboration error #684
|
- 🐛(frontend) fix collaboration error #684
|
||||||
- 🔒️(back) restrict access to favorite_list endpoint #690
|
|
||||||
|
|
||||||
## [2.3.0] - 2025-03-03
|
## [2.3.0] - 2025-03-03
|
||||||
|
|
||||||
|
|||||||
@@ -48,16 +48,27 @@ export const TableContent = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
document.getElementById(MAIN_LAYOUT_ID)?.addEventListener('scroll', () => {
|
let timeout: NodeJS.Timeout;
|
||||||
setTimeout(() => {
|
const scrollFn = () => {
|
||||||
|
if (timeout) {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout = setTimeout(() => {
|
||||||
handleScroll();
|
handleScroll();
|
||||||
}, 300);
|
}, 300);
|
||||||
});
|
};
|
||||||
|
|
||||||
|
document
|
||||||
|
.getElementById(MAIN_LAYOUT_ID)
|
||||||
|
?.addEventListener('scroll', scrollFn);
|
||||||
|
|
||||||
handleScroll();
|
handleScroll();
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener('scroll', handleScroll);
|
document
|
||||||
|
.getElementById(MAIN_LAYOUT_ID)
|
||||||
|
?.removeEventListener('scroll', scrollFn);
|
||||||
};
|
};
|
||||||
}, [headings, setHeadingIdHighlight]);
|
}, [headings, setHeadingIdHighlight]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user