virtua 0.42.3 → 0.43.0

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.
@@ -1276,6 +1276,7 @@ const ListItem = (props) => {
1276
1276
  const style = createMemo(() => {
1277
1277
  const isHorizontal = props._isHorizontal;
1278
1278
  const style = {
1279
+ contain: "layout style",
1279
1280
  position: "absolute",
1280
1281
  [isHorizontal ? "height" : "width"]: "100%",
1281
1282
  [isHorizontal ? "top" : "left"]: "0px",
@@ -1429,12 +1430,11 @@ const Virtualizer = (props) => {
1429
1430
  return (<ListItem _as={props.item} _index={index()} _resizer={resizer.$observeItem} _offset={offset()} _hide={hide()} _children={children()} _isHorizontal={horizontal}/>);
1430
1431
  };
1431
1432
  return (<Dynamic component={props.as} ref={containerRef} style={{
1432
- // contain: "content",
1433
+ contain: "strict",
1433
1434
  "overflow-anchor": "none", // opt out browser's scroll anchoring because it will conflict to scroll anchoring of virtualizer
1434
1435
  overflow: "clip", // https://github.com/inokawa/virtua/pull/485 https://github.com/inokawa/virtua/issues/717
1435
1436
  flex: "none", // flex style can break layout
1436
1437
  position: "relative",
1437
- visibility: "hidden", // TODO replace with other optimization methods
1438
1438
  width: horizontal ? totalSize() + "px" : "100%",
1439
1439
  height: horizontal ? "100%" : totalSize() + "px",
1440
1440
  "pointer-events": isScrolling() ? "none" : undefined,
@@ -1558,12 +1558,11 @@ const WindowVirtualizer = (props) => {
1558
1558
  return end >= 0 ? props.data.slice(start, end + 1) : [];
1559
1559
  });
1560
1560
  return (<div ref={containerRef} style={{
1561
- // contain: "content",
1561
+ contain: "strict",
1562
1562
  "overflow-anchor": "none", // opt out browser's scroll anchoring because it will conflict to scroll anchoring of virtualizer
1563
1563
  overflow: "clip", // https://github.com/inokawa/virtua/pull/485 https://github.com/inokawa/virtua/issues/717
1564
1564
  flex: "none", // flex style can break layout
1565
1565
  position: "relative",
1566
- visibility: "hidden", // TODO replace with other optimization methods
1567
1566
  width: horizontal ? totalSize() + "px" : "100%",
1568
1567
  height: horizontal ? "100%" : totalSize() + "px",
1569
1568
  "pointer-events": isScrolling() ? "none" : undefined,