ant-design 当message最外层包裹元素div dom被移除,之后message实例便不会再创建

pw136qt2  于 4个月前  发布在  其他
关注(0)|答案(5)|浏览(123)
  • I have searched the issues of this repository and believe that this is not a duplicate.

Steps to reproduce

//操作:1 打开弹窗
// 2. 点击show message
// 3. 点击ok 关闭弹窗
// 4. 打开弹窗
// 5. 点击show message

What is expected?

message正常显示

What is actually happening?

message未正常显示

建议: 在rc-notification,对于返回的notificationInstance对象添加判断方法,如
messageWrapperExit() {
if (getContainer) {
const root = getContainer();
return root.contains(div);
}
return document.body.contains(div);
}
并且在上层message组件中添加是否新创建 实例的判断
if (messageInstance && msgInstance.messageWrapperExit()) {
callback({ prefixCls, rootPrefixCls, iconPrefixCls, instance: messageInstance });
return;
}
| Environment | Info |
| ------------ | ------------ |
| antd | 4.18.4 |
| React | react-dom16.X.X |
| System | macos |
| Browser | chrome |

vyswwuz2

vyswwuz21#

你的 CodeSandbox 里什么都没有捏

kt06eoxx

kt06eoxx2#

Hello @TiamoJrZhang. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 3 days.

你好 @TiamoJrZhang, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。

o8x7eapl

o8x7eapl4#

rc-notification commit the pr to solve it and add test.

wfypjpf4

wfypjpf45#

why all of antd message tests failed when npm link rc-notification,even if rc-notification code is not update

相关问题