@chronocide/hyper 1.1.0 → 1.1.2

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.
Files changed (2) hide show
  1. package/dist/hyper.js +2 -2
  2. package/package.json +1 -1
package/dist/hyper.js CHANGED
@@ -179,7 +179,7 @@ const virtual$1 = (env) => (cell) => (render) => (root) => {
179
179
  let cache = [];
180
180
  let state = [];
181
181
  const update = debounce(env)((full) => {
182
- if (full) cache = cells(cell)({ width: root.scrollWidth })(state);
182
+ if (full) cache = cells(cell)({ width: root.getBoundingClientRect().width })(state);
183
183
  const [min, max] = view({
184
184
  height: root.getBoundingClientRect().height,
185
185
  y: Math.floor(root.scrollTop)
@@ -204,7 +204,7 @@ const virtual$1 = (env) => (cell) => (render) => (root) => {
204
204
  }), spacer);
205
205
  });
206
206
  root.addEventListener("scroll", () => update(false), { passive: true });
207
- root.addEventListener("resize", () => update(true), { passive: true });
207
+ env.window.addEventListener("resize", () => update(true), { passive: true });
208
208
  return {
209
209
  update: (next) => {
210
210
  state = next;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chronocide/hyper",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "type": "module",
5
5
  "types": "dist/hyper.d.ts",
6
6
  "exports": {