Skip to content

Commit

Permalink
fix(antd,next): fix ie.tsx ssr bug (#936)
Browse files Browse the repository at this point in the history
Change-Id: I019f4f58a62940a02cb49b1658559275c8e88b31
  • Loading branch information
YYCoder authored Jul 3, 2020
1 parent c8dd390 commit 0d3c381
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/antd/src/components/FormMegaLayout/ie.tsx
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -70,4 +72,4 @@ const getIEGridItemStyle = (opts) => {
export {
getIEGridContainerStyle,
getIEGridItemStyle,
}
}
6 changes: 4 additions & 2 deletions packages/next/src/components/FormMegaLayout/ie.tsx
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -69,4 +71,4 @@ const getIEGridItemStyle = (opts) => {
export {
getIEGridContainerStyle,
getIEGridItemStyle,
}
}

0 comments on commit 0d3c381

Please sign in to comment.