@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.esm.js CHANGED
@@ -5101,8 +5101,9 @@ var hideOthers = function hideOthers(originalTarget, parentNode, markerName) {
5101
5101
  return null;
5102
5102
  };
5103
5103
  }
5104
- // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10
5105
- targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]')));
5104
+ // we should not hide aria-live elements - https://github.com/theKashey/aria-hidden/issues/10
5105
+ // and script elements, as they have no impact on accessibility.
5106
+ targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live], script')));
5106
5107
  return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');
5107
5108
  };
5108
5109
 
@@ -5159,15 +5160,15 @@ function Effect(_a) {
5159
5160
  mouseTouches.current = event.touches.length;
5160
5161
  };
5161
5162
  if (activeNode) {
5162
- document.addEventListener('keydown', onKeyDown);
5163
- document.addEventListener('mousedown', onMouseDown);
5164
- document.addEventListener('touchstart', onTouchStart);
5165
- document.addEventListener('touchend', onTouchEnd);
5163
+ activeNode.ownerDocument.addEventListener('keydown', onKeyDown);
5164
+ activeNode.ownerDocument.addEventListener('mousedown', onMouseDown);
5165
+ activeNode.ownerDocument.addEventListener('touchstart', onTouchStart);
5166
+ activeNode.ownerDocument.addEventListener('touchend', onTouchEnd);
5166
5167
  return function () {
5167
- document.removeEventListener('keydown', onKeyDown);
5168
- document.removeEventListener('mousedown', onMouseDown);
5169
- document.removeEventListener('touchstart', onTouchStart);
5170
- document.removeEventListener('touchend', onTouchEnd);
5168
+ activeNode.ownerDocument.removeEventListener('keydown', onKeyDown);
5169
+ activeNode.ownerDocument.removeEventListener('mousedown', onMouseDown);
5170
+ activeNode.ownerDocument.removeEventListener('touchstart', onTouchStart);
5171
+ activeNode.ownerDocument.removeEventListener('touchend', onTouchEnd);
5171
5172
  };
5172
5173
  }
5173
5174
  }, [activeNode, onClickOutside, onEscapeKey]);
@@ -5190,7 +5191,7 @@ function Effect(_a) {
5190
5191
  var unmounted = false;
5191
5192
  var onNodeActivation = function onNodeActivation(node) {
5192
5193
  if (!noIsolation) {
5193
- _undo = hideOthers(__spreadArrays([node], (shards || []).map(extractRef)), document.body, focusHiddenMarker);
5194
+ _undo = hideOthers(__spreadArrays([node], (shards || []).map(extractRef)), node.ownerDocument.body, focusHiddenMarker);
5194
5195
  }
5195
5196
  setActiveNode(function () {
5196
5197
  return node;