@moda/om 21.0.1 → 21.1.1

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/index.cjs.js CHANGED
@@ -5121,8 +5121,9 @@ var hideOthers = function hideOthers(originalTarget, parentNode, markerName) {
5121
5121
  return null;
5122
5122
  };
5123
5123
  }
5124
- // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10
5125
- targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]')));
5124
+ // we should not hide aria-live elements - https://github.com/theKashey/aria-hidden/issues/10
5125
+ // and script elements, as they have no impact on accessibility.
5126
+ targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live], script')));
5126
5127
  return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');
5127
5128
  };
5128
5129
 
@@ -5179,15 +5180,15 @@ function Effect(_a) {
5179
5180
  mouseTouches.current = event.touches.length;
5180
5181
  };
5181
5182
  if (activeNode) {
5182
- document.addEventListener('keydown', onKeyDown);
5183
- document.addEventListener('mousedown', onMouseDown);
5184
- document.addEventListener('touchstart', onTouchStart);
5185
- document.addEventListener('touchend', onTouchEnd);
5183
+ activeNode.ownerDocument.addEventListener('keydown', onKeyDown);
5184
+ activeNode.ownerDocument.addEventListener('mousedown', onMouseDown);
5185
+ activeNode.ownerDocument.addEventListener('touchstart', onTouchStart);
5186
+ activeNode.ownerDocument.addEventListener('touchend', onTouchEnd);
5186
5187
  return function () {
5187
- document.removeEventListener('keydown', onKeyDown);
5188
- document.removeEventListener('mousedown', onMouseDown);
5189
- document.removeEventListener('touchstart', onTouchStart);
5190
- document.removeEventListener('touchend', onTouchEnd);
5188
+ activeNode.ownerDocument.removeEventListener('keydown', onKeyDown);
5189
+ activeNode.ownerDocument.removeEventListener('mousedown', onMouseDown);
5190
+ activeNode.ownerDocument.removeEventListener('touchstart', onTouchStart);
5191
+ activeNode.ownerDocument.removeEventListener('touchend', onTouchEnd);
5191
5192
  };
5192
5193
  }
5193
5194
  }, [activeNode, onClickOutside, onEscapeKey]);
@@ -5210,7 +5211,7 @@ function Effect(_a) {
5210
5211
  var unmounted = false;
5211
5212
  var onNodeActivation = function onNodeActivation(node) {
5212
5213
  if (!noIsolation) {
5213
- _undo = hideOthers(__spreadArrays([node], (shards || []).map(extractRef)), document.body, focusHiddenMarker);
5214
+ _undo = hideOthers(__spreadArrays([node], (shards || []).map(extractRef)), node.ownerDocument.body, focusHiddenMarker);
5214
5215
  }
5215
5216
  setActiveNode(function () {
5216
5217
  return node;