@lumx/react 3.6.7-alpha.2 → 3.6.7-alpha.3

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/index.d.ts CHANGED
@@ -794,8 +794,6 @@ interface PopoverProps extends GenericProps, HasTheme {
794
794
  placement?: Placement;
795
795
  /** Whether the popover should be rendered into a DOM node that exists outside the DOM hierarchy of the parent component. */
796
796
  usePortal?: boolean;
797
- /** The element in which the focus trap should be set. Default to popover. */
798
- focusTrapZoneElement?: RefObject<HTMLElement>;
799
797
  /** Z-axis position. */
800
798
  zIndex?: number;
801
799
  /** On close callback (on click away or Escape pressed). */
package/index.js CHANGED
@@ -2668,8 +2668,7 @@ const DISABLED_SELECTOR = `[hidden], [tabindex="-1"], [disabled]:not([disabled="
2668
2668
 
2669
2669
  const isNotDisabled = element => !element.matches(DISABLED_SELECTOR);
2670
2670
  function getFocusableElements(element) {
2671
- const focusableElements = element.shadowRoot ? getFocusableElements(element.shadowRoot) : Array.from(element.querySelectorAll(TABBABLE_ELEMENTS_SELECTOR)).filter(isNotDisabled);
2672
- return focusableElements;
2671
+ return Array.from(element.querySelectorAll(TABBABLE_ELEMENTS_SELECTOR)).filter(isNotDisabled);
2673
2672
  }
2674
2673
 
2675
2674
  /**
@@ -6539,7 +6538,7 @@ function usePopoverStyle(_ref5) {
6539
6538
  };
6540
6539
  }
6541
6540
 
6542
- const _excluded$m = ["anchorRef", "as", "children", "className", "closeOnClickAway", "closeOnEscape", "elevation", "focusElement", "hasArrow", "isOpen", "onClose", "parentElement", "usePortal", "focusAnchorOnClose", "withFocusTrap", "boundaryRef", "fitToAnchorWidth", "fitWithinViewportHeight", "focusTrapZoneElement", "offset", "placement", "style", "theme", "zIndex"];
6541
+ const _excluded$m = ["anchorRef", "as", "children", "className", "closeOnClickAway", "closeOnEscape", "elevation", "focusElement", "hasArrow", "isOpen", "onClose", "parentElement", "usePortal", "focusAnchorOnClose", "withFocusTrap", "boundaryRef", "fitToAnchorWidth", "fitWithinViewportHeight", "offset", "placement", "style", "theme", "zIndex"];
6543
6542
 
6544
6543
  /**
6545
6544
  * Defines the props of the component.
@@ -6592,7 +6591,6 @@ const _InnerPopover = /*#__PURE__*/forwardRef((props, ref) => {
6592
6591
  boundaryRef,
6593
6592
  fitToAnchorWidth,
6594
6593
  fitWithinViewportHeight,
6595
- focusTrapZoneElement,
6596
6594
  offset,
6597
6595
  placement,
6598
6596
  style,
@@ -6626,12 +6624,11 @@ const _InnerPopover = /*#__PURE__*/forwardRef((props, ref) => {
6626
6624
  anchorRef,
6627
6625
  parentElement
6628
6626
  }, popperElement);
6629
- const focusZoneElement = (focusTrapZoneElement === null || focusTrapZoneElement === void 0 ? void 0 : focusTrapZoneElement.current) || (popoverRef === null || popoverRef === void 0 ? void 0 : popoverRef.current);
6630
6627
  useCallbackOnEscape(onClose, isOpen && closeOnEscape);
6631
6628
 
6632
6629
  /** Only set focus within if the focus trap is disabled as they interfere with one another. */
6633
6630
  useFocus(focusElement === null || focusElement === void 0 ? void 0 : focusElement.current, !withFocusTrap && isOpen && isPositioned);
6634
- useFocusTrap(withFocusTrap && isOpen && focusZoneElement, focusElement === null || focusElement === void 0 ? void 0 : focusElement.current);
6631
+ useFocusTrap(withFocusTrap && isOpen && (popoverRef === null || popoverRef === void 0 ? void 0 : popoverRef.current), focusElement === null || focusElement === void 0 ? void 0 : focusElement.current);
6635
6632
  const clickAwayRefs = useRef([popoverRef, anchorRef]);
6636
6633
  const mergedRefs = useMergeRefs(setPopperElement, ref, popoverRef);
6637
6634
  return isOpen ? renderPopover( /*#__PURE__*/React.createElement(Component, _extends({}, forwardedProps, {