v1.31 - Scroll fix
This commit is contained in:
+2
-4
@@ -327,10 +327,8 @@ export function UTCIForecast() {
|
|||||||
const onClickOutside = (e) => {
|
const onClickOutside = (e) => {
|
||||||
if (colPopupRef.current && !colPopupRef.current.contains(e.target)) closePopup();
|
if (colPopupRef.current && !colPopupRef.current.contains(e.target)) closePopup();
|
||||||
};
|
};
|
||||||
const onScrollOrResize = () => {
|
// Close on scroll (avoids scroll-linked jank) or resize
|
||||||
if (!colPopupThRef.current) return;
|
const onScrollOrResize = () => closePopup();
|
||||||
setColPopup(prev => prev ? { ...prev, ...calcPopupPos(colPopupThRef.current) } : null);
|
|
||||||
};
|
|
||||||
document.addEventListener('mousedown', onClickOutside);
|
document.addEventListener('mousedown', onClickOutside);
|
||||||
window.addEventListener('scroll', onScrollOrResize, { passive: true, capture: true });
|
window.addEventListener('scroll', onScrollOrResize, { passive: true, capture: true });
|
||||||
window.addEventListener('resize', onScrollOrResize, { passive: true });
|
window.addEventListener('resize', onScrollOrResize, { passive: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user