Skip to content

Commit

Permalink
fix: #1461
Browse files Browse the repository at this point in the history
  • Loading branch information
solarjoker committed Dec 23, 2020
1 parent e9cbff9 commit 4c967f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 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}>
<PortalWrapper mountNode={mountNode} visible={visible}>
{children}
{children || mountNode ? (
<div className={maskCls}>
Expand Down Expand Up @@ -56,12 +56,10 @@ Loading.defaultProps = {
size: 'default'
}

function PortalWrapper({ mountNode, children }) {
return mountNode ? (
ReactDOM.createPortal(children, mountNode)
) : (
<div className={`${prefixCls}__wrapper`}>{children}</div>
)
function PortalWrapper({ mountNode, children, visible }) {
return mountNode
? ReactDOM.createPortal(children, mountNode)
: visible !== false && <div className={`${prefixCls}__wrapper`}>{children}</div>
}

function open(target, { content, key, duration, size } = {}) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hi-ui/hiui",
"version": "3.3.0-rc.4",
"version": "3.3.0-rc.7",
"description": "HIUI for React",
"scripts": {
"test": "node_modules/.bin/standard && node_modules/.bin/stylelint --config .stylelintrc 'components/**/*.scss'",
Expand Down

0 comments on commit 4c967f8

Please sign in to comment.