@jsenv/dom 0.17.84 → 0.17.86

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/jsenv_dom.js +19 -17
  2. package/package.json +1 -1
package/dist/jsenv_dom.js CHANGED
@@ -4976,14 +4976,19 @@ const getFocusVisibilityInfo = (node, { excludeAriaHidden } = {}) => {
4976
4976
  }
4977
4977
  // Continue checking ancestors
4978
4978
  }
4979
- if (elementIsDialog(nodeOrAncestor) && !nodeOrAncestor.open) {
4980
- return { visible: false, reason: "inside closed dialog element" };
4981
- }
4979
+ const isPopover =
4980
+ nodeOrAncestor.popover !== null && nodeOrAncestor.popover !== undefined;
4981
+ const isOpenPopover = isPopover && nodeOrAncestor.matches(":popover-open");
4982
+ // A dialog shown as a popover (showPopover()) is open without `open`,
4983
+ // which only show() and showModal() set.
4982
4984
  if (
4983
- nodeOrAncestor.popover !== null &&
4984
- nodeOrAncestor.popover !== undefined &&
4985
- !nodeOrAncestor.matches(":popover-open")
4985
+ elementIsDialog(nodeOrAncestor) &&
4986
+ !nodeOrAncestor.open &&
4987
+ !isOpenPopover
4986
4988
  ) {
4989
+ return { visible: false, reason: "inside closed dialog element" };
4990
+ }
4991
+ if (isPopover && !isOpenPopover) {
4987
4992
  return { visible: false, reason: "inside closed popover element" };
4988
4993
  }
4989
4994
  // Open popovers and open dialogs render in the top layer: they escape
@@ -4992,11 +4997,7 @@ const getFocusVisibilityInfo = (node, { excludeAriaHidden } = {}) => {
4992
4997
  if (elementIsDialog(nodeOrAncestor) && nodeOrAncestor.open) {
4993
4998
  break;
4994
4999
  }
4995
- if (
4996
- nodeOrAncestor.popover !== null &&
4997
- nodeOrAncestor.popover !== undefined &&
4998
- nodeOrAncestor.matches(":popover-open")
4999
- ) {
5000
+ if (isOpenPopover) {
5000
5001
  break;
5001
5002
  }
5002
5003
  nodeOrAncestor = nodeOrAncestor.parentNode;
@@ -5251,8 +5252,8 @@ const findFocusable = (element, { exclude } = {}) => {
5251
5252
  // - `clip` is not one. It clips and stops there: it has no scroll box at all,
5252
5253
  // and scrollTop/scrollLeft on it read back 0 whatever they are set to. That
5253
5254
  // is the whole reason a layout reaches for it (see navi's
5254
- // docs/mobile_layout_pitfalls.md), so it is never included, whatever the
5255
- // caller asks for.
5255
+ // docs/safe_area.md#a-document-wider-than-the-screen), so it is never
5256
+ // included, whatever the caller asks for.
5256
5257
  // `visible` is the other non-scrolling value, and the only one on which the
5257
5258
  // content still reaches the ancestors.
5258
5259
  const isScrollable = (element, { includeHidden } = {}) => {
@@ -15039,10 +15040,11 @@ const startDragTo = (
15039
15040
  * A press that WOULD be a drag, and is not.
15040
15041
  *
15041
15042
  * Recognized exactly as `startDragTo` recognizes it: the intent is established by
15042
- * the same threshold — a mouse travelling, a finger holding still, the first
15043
- * pixel inside a `[data-drag-on-contact]`. What differs is what happens once it
15044
- * is established: nothing is grabbed, nothing translates, and `onRefuse` is told
15045
- * at the instant the grab would have been acquired.
15043
+ * the same threshold — a mouse travelling a few pixels, a finger holding still,
15044
+ * or travelling those same few pixels inside a `[data-drag-on-contact]`. What
15045
+ * differs is what happens once it is established: nothing is grabbed, nothing
15046
+ * translates, and `onRefuse` is told at the instant the grab would have been
15047
+ * acquired.
15046
15048
  *
15047
15049
  * That instant is the whole point. An object that stays put under the hand and
15048
15050
  * says nothing reads as a screen that is broken, and the hand pulls harder; the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/dom",
3
- "version": "0.17.84",
3
+ "version": "0.17.86",
4
4
  "type": "module",
5
5
  "description": "DOM utilities for writing frontend code",
6
6
  "repository": {