Browse Source

fix: modalElIterator可能为空,导致报错 (#3738)

KaneOne 1 year ago
parent
commit
162a0d0252
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/components/Table/src/hooks/useTableScroll.ts

+ 1 - 0
src/components/Table/src/hooks/useTableScroll.ts

@@ -194,6 +194,7 @@ export function useTableScroll(
     let modalElIterator: HTMLElement = tableEl.parentElement!;
     let modalIsFullscreen = false;
     while (modalElIterator !== document.body) {
+      if(!modalElIterator) break;
       if (modalElIterator.classList.contains('ant-modal')) {
         modalEl = modalElIterator;
         modalWrapEl = modalEl.parentElement;