@linzjs/step-ag-grid 27.3.1 → 27.3.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.
@@ -1790,8 +1790,9 @@ const MenuList = ({ ariaLabel, menuClassName, menuStyle, arrowClassName, arrowSt
1790
1790
  }, [reposition]);
1791
1791
  // Matt added window resize observer
1792
1792
  useEffect(() => {
1793
- if (typeof ResizeObserver !== 'function' || reposition === 'initial')
1793
+ if (typeof ResizeObserver !== 'function' || reposition === 'initial' || !menuRef.current) {
1794
1794
  return;
1795
+ }
1795
1796
  const callback = debounce$1(() => {
1796
1797
  const { width, height } = menuRef.current.ownerDocument.body.getBoundingClientRect();
1797
1798
  if (width === 0 || height === 0)
@@ -1840,7 +1841,7 @@ const MenuList = ({ ariaLabel, menuClassName, menuStyle, arrowClassName, arrowSt
1840
1841
  // Use a timeout here because if set focus immediately, page might scroll unexpectedly.
1841
1842
  const id = setTimeout(() => {
1842
1843
  // If focus has already been set to a children element, don't set focus on menu or item
1843
- if (!menuRef.current.contains(document.activeElement)) {
1844
+ if (menuRef.current && !menuRef.current.contains(document.activeElement)) {
1844
1845
  // Handle popover portal focus
1845
1846
  const popupElement = focusRef.current?.nextSibling;
1846
1847
  if (!focusFirstInput(popupElement)) {