diff --git a/packages/antd/src/components/FormMegaLayout/ie.tsx b/packages/antd/src/components/FormMegaLayout/ie.tsx index 107d0d835e4..ace1dfd9e0d 100644 --- a/packages/antd/src/components/FormMegaLayout/ie.tsx +++ b/packages/antd/src/components/FormMegaLayout/ie.tsx @@ -1,4 +1,6 @@ -const isIECompat = !('grid-column-gap' in document?.documentElement?.style) +import { globalThisPolyfill } from '@formily/shared' + +const isIECompat = !('grid-column-gap' in globalThisPolyfill?.document?.documentElement?.style) const getIEGridContainerStyle = (opts) => { if (isIECompat) { const { gutter, autoRow } = opts @@ -70,4 +72,4 @@ const getIEGridItemStyle = (opts) => { export { getIEGridContainerStyle, getIEGridItemStyle, -} \ No newline at end of file +} diff --git a/packages/next/src/components/FormMegaLayout/ie.tsx b/packages/next/src/components/FormMegaLayout/ie.tsx index 5c720e3a229..81fb63d2f19 100644 --- a/packages/next/src/components/FormMegaLayout/ie.tsx +++ b/packages/next/src/components/FormMegaLayout/ie.tsx @@ -1,4 +1,6 @@ -const isIECompat = !('grid-column-gap' in document?.documentElement?.style) +import { globalThisPolyfill } from '@formily/shared' + +const isIECompat = !('grid-column-gap' in globalThisPolyfill?.document?.documentElement?.style) const getIEGridContainerStyle = (opts) => { if (isIECompat) { const { gutter, autoRow } = opts @@ -69,4 +71,4 @@ const getIEGridItemStyle = (opts) => { export { getIEGridContainerStyle, getIEGridItemStyle, -} \ No newline at end of file +}