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