@jsenv/dom 0.14.5 → 0.14.6

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/dist/jsenv_dom.js CHANGED
@@ -11349,9 +11349,11 @@ const visibleRectEffect = (
11349
11349
  }
11350
11350
  }
11351
11351
  {
11352
- // visualViewport resize is a superset of window resize:
11353
- // it also fires when the virtual keyboard opens/closes on mobile.
11354
- // Fall back to window resize when visualViewport is unavailable.
11352
+ // visualViewport resize fires when the virtual keyboard opens/closes on mobile.
11353
+ // window resize catches cases visualViewport misses, notably the browser input
11354
+ // accessory bar (password/autocomplete suggestions) on iOS Safari which changes
11355
+ // the available height without always firing a visualViewport resize event.
11356
+ // We listen to both simultaneously; the check is idempotent so duplicates are harmless.
11355
11357
  const onResize = (e) => {
11356
11358
  autoCheck(e);
11357
11359
  };
@@ -11360,12 +11362,11 @@ const visibleRectEffect = (
11360
11362
  addTeardown(() => {
11361
11363
  window.visualViewport.removeEventListener("resize", onResize);
11362
11364
  });
11363
- } else {
11364
- window.addEventListener("resize", onResize);
11365
- addTeardown(() => {
11366
- window.removeEventListener("resize", onResize);
11367
- });
11368
11365
  }
11366
+ window.addEventListener("resize", onResize);
11367
+ addTeardown(() => {
11368
+ window.removeEventListener("resize", onResize);
11369
+ });
11369
11370
  }
11370
11371
  {
11371
11372
  // visualViewport scroll fires when the visual viewport pans independently
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/dom",
3
- "version": "0.14.5",
3
+ "version": "0.14.6",
4
4
  "type": "module",
5
5
  "description": "DOM utilities for writing frontend code",
6
6
  "repository": {