@diwauhris/ui 1.7.33 → 1.7.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +2 -6
- package/lib/index.mjs +2 -6
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -1246,19 +1246,15 @@ function Combobox({ value: controlledValue, defaultValue = "", onChange, options
|
|
|
1246
1246
|
overscrollBehavior: "contain"
|
|
1247
1247
|
});
|
|
1248
1248
|
};
|
|
1249
|
-
const closeOnScroll = (e) => {
|
|
1250
|
-
if (listRef.current && listRef.current.contains(e.target)) return;
|
|
1251
|
-
setIsOpen(false);
|
|
1252
|
-
};
|
|
1253
1249
|
const raf = requestAnimationFrame(updatePosition);
|
|
1254
|
-
window.addEventListener("scroll",
|
|
1250
|
+
window.addEventListener("scroll", updatePosition, {
|
|
1255
1251
|
capture: true,
|
|
1256
1252
|
passive: true
|
|
1257
1253
|
});
|
|
1258
1254
|
window.addEventListener("resize", updatePosition);
|
|
1259
1255
|
return () => {
|
|
1260
1256
|
cancelAnimationFrame(raf);
|
|
1261
|
-
window.removeEventListener("scroll",
|
|
1257
|
+
window.removeEventListener("scroll", updatePosition, { capture: true });
|
|
1262
1258
|
window.removeEventListener("resize", updatePosition);
|
|
1263
1259
|
};
|
|
1264
1260
|
}, [isOpen]);
|
package/lib/index.mjs
CHANGED
|
@@ -1222,19 +1222,15 @@ function Combobox({ value: controlledValue, defaultValue = "", onChange, options
|
|
|
1222
1222
|
overscrollBehavior: "contain"
|
|
1223
1223
|
});
|
|
1224
1224
|
};
|
|
1225
|
-
const closeOnScroll = (e) => {
|
|
1226
|
-
if (listRef.current && listRef.current.contains(e.target)) return;
|
|
1227
|
-
setIsOpen(false);
|
|
1228
|
-
};
|
|
1229
1225
|
const raf = requestAnimationFrame(updatePosition);
|
|
1230
|
-
window.addEventListener("scroll",
|
|
1226
|
+
window.addEventListener("scroll", updatePosition, {
|
|
1231
1227
|
capture: true,
|
|
1232
1228
|
passive: true
|
|
1233
1229
|
});
|
|
1234
1230
|
window.addEventListener("resize", updatePosition);
|
|
1235
1231
|
return () => {
|
|
1236
1232
|
cancelAnimationFrame(raf);
|
|
1237
|
-
window.removeEventListener("scroll",
|
|
1233
|
+
window.removeEventListener("scroll", updatePosition, { capture: true });
|
|
1238
1234
|
window.removeEventListener("resize", updatePosition);
|
|
1239
1235
|
};
|
|
1240
1236
|
}, [isOpen]);
|