GithubHelp home page GithubHelp logo

Comments (15)

zombieJ avatar zombieJ commented on May 12, 2024

The modal will be closed after two seconds 的意思是 这个窗口两秒后会关掉,它和窗体改变大小没有关系,是 Demo 本身的逻辑。或者提供一个干净的重现代码看看?

from ant-design.

github-actions avatar github-actions commented on May 12, 2024

Hello @WeMadeCode. Please provide a online reproduction by forking codesandbox of [email protected] or [email protected], or provide a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 3 days.

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

什么是最小化重现,为什么这是必需的?

from ant-design.

WeMadeCode avatar WeMadeCode commented on May 12, 2024

@zombieJ 你好。我使用本地Demo 未能复现改问题。但是我使用官网复现了改问题。
可以参考下 如下录屏

2024-04-28.09.39.49.mov

from ant-design.

wanpan11 avatar wanpan11 commented on May 12, 2024

我使用本地Demo 未能复现改问题。但是我使用官网复现了改问题。 可以参考下 如下录屏

@WeMadeCode 业务里你能复现吗,目前我试的只有官网多demo时能复现(把其他 demo 注释掉后,也无法复现)

from ant-design.

WeMadeCode avatar WeMadeCode commented on May 12, 2024

@wanpan11 业务里面也能 稳定复现。使用的代码 就是 【Open Modal with async loginc】。但是 我新建Demo 使用【Open Modal with async loginc】 也就无法复现了。不确定 是不是其他代码 其他影响了 这个Modal组件。

from ant-design.

linxianxi avatar linxianxi commented on May 12, 2024

官网是因为缩小后布局改变成一列,右边这个 section 整合到左边这个 section 里了,所以是先卸载(Modal 就没了)再重新 mount 了。你的业务有 bug 应该是你自己的问题。
image

from ant-design.

wanpan11 avatar wanpan11 commented on May 12, 2024

@WeMadeCode Modal 本身没问题,官网的 demo 组件每次在屏幕尺寸变化导致 demo 换行的时候就会把 组件卸载掉,https://ant.design/components/modal-cn#components-modal-demo-static-info 用静态方法的就不会,你再检查下你的逻辑撒的
image

from ant-design.

WeMadeCode avatar WeMadeCode commented on May 12, 2024

@WeMadeCode Modal 本身没问题,官网的 demo 组件每次在屏幕尺寸变化导致 demo 换行的时候就会把 组件卸载掉,https://ant.design/components/modal-cn#components-modal-demo-static-info 用静态方法的就不会,你再检查下你的逻辑撒的 image

@wanpan11 你好,我想继续了解下 【官网的 demo 组件每次在屏幕尺寸变化导致 demo 换行的时候就会把 组件卸载掉】这个动作是 Modal做的,还是官方Demo 主动卸载的?

from ant-design.

wanpan11 avatar wanpan11 commented on May 12, 2024

这个动作是 Modal做的,还是官方Demo 主动卸载的?

这是官网的行为 与 Modal 自身无关,看下@linxianxi 的回复 他的更清楚一些

from ant-design.

WeMadeCode avatar WeMadeCode commented on May 12, 2024

官网是因为缩小后布局改变成一列,右边这个 section 整合到左边这个 section 里了,所以是先卸载(Modal 就没了)再重新 mount 了。你的业务有 bug 应该是你自己的问题。 image

@wanpan11 是不是父元素(这里是session)尺寸位置的变化导致了 Modal被销毁了?

from ant-design.

wanpan11 avatar wanpan11 commented on May 12, 2024

是 section 所在的组件卸载了,导致 Modal 也跟着卸载了

from ant-design.

WeMadeCode avatar WeMadeCode commented on May 12, 2024

是 section 所在的组件卸载了,导致 Modal 也跟着卸载了

@wanpan11 Modal 直接挂载在 Body 下面的, 其实际直接父元素应该是Body。但是这里却受 理论上的父元素(这里是Session)的销毁影响。这是不是问题?

from ant-design.

wanpan11 avatar wanpan11 commented on May 12, 2024

组件 和 dom 是不一样,可以看看相关的文章哦~

from ant-design.

WeMadeCode avatar WeMadeCode commented on May 12, 2024

是 section 所在的组件卸载了,导致 Modal 也跟着卸载了

@wanpan11 所以 您觉得 【是 section 所在的组件卸载了,导致 Modal 也跟着卸载了】这不是问题 是么?

from ant-design.

wanpan11 avatar wanpan11 commented on May 12, 2024

section 是人为卸载的 是在预期之中的。

from ant-design.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.