Skip to content

Commit

Permalink
Merge pull request #1465 from XiaoMi/hotfix/#1461-3
Browse files Browse the repository at this point in the history
Hotfix/#1461 3
  • Loading branch information
GleanCoder1116 authored Dec 23, 2020
2 parents aa597e8 + 7b0d975 commit 2d7af3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions components/loading/Loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Loading extends Component {
[`${prefixCls}__mask--hide`]: visible === false
})
return (
<PortalWrapper mountNode={mountNode} visible={visible}>
<PortalWrapper mountNode={mountNode} needWrapper={!!children}>
{children}
{children || mountNode ? (
<div className={maskCls}>
Expand Down Expand Up @@ -58,10 +58,10 @@ Loading.defaultProps = {
size: 'default'
}

function PortalWrapper({ mountNode, children, visible }) {
function PortalWrapper({ mountNode, children, needWrapper }) {
return mountNode ? (
ReactDOM.createPortal(children, mountNode)
) : visible ? (
) : needWrapper ? (
<div className={`${prefixCls}__wrapper`}>{children}</div>
) : (
children
Expand Down
6 changes: 3 additions & 3 deletions components/table/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const Table = ({
)
}

const TableWrapper = ({ columns, uniqueId, standard, data, loading = false, ...settingProps }) => {
const TableWrapper = ({ columns, uniqueId, standard, data, loading, ...settingProps }) => {
const _sortCol =
uniqueId && window.localStorage.getItem(`${uniqueId}_sortCol`)
? JSON.parse(window.localStorage.getItem(`${uniqueId}_sortCol`))
Expand Down Expand Up @@ -317,8 +317,8 @@ const TableWrapper = ({ columns, uniqueId, standard, data, loading = false, ...s
: {}

// ***************
return loading === true ? (
<Loading>
return loading !== undefined ? (
<Loading visible={loading}>
<Table
columns={cacheVisibleCols}
data={data || []}
Expand Down

0 comments on commit 2d7af3b

Please sign in to comment.