Skip to content

项目中引入了zone.js #28537

Closed
Closed

Description

@yxxuweb
  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

引入了zone.js,Popver组件弹出时,导致浏览器挂掉

What is expected?

正常弹出

What is actually happening?

没有弹出,浏览器进程挂掉

Environment Info
antd 4.9.4
React 17.0.1
System window
Browser chrome

项目引入antd,zone.js,会导致antd Popver组件在触发弹出层时浏览器崩溃。

Activity

  1. xrkffgg commented on Dec 25, 2020

    @xrkffgg
    Member

    你给的 codesandbox , 我看点开可以弹出

  2. zombieJ commented on Dec 25, 2020

    @zombieJ
    Member

    zone.js 会修改上下文,和 antd 本身无关。

  3. vicrep commented on Jan 5, 2021

    @vicrep
    Contributor

    @zombieJ for what it's worth, I've been dealing with this issue too, and don't believe it to be invalid. The provided codesandbox makes it a little hard to repro (you have to click on the right button then quickly try to hover on the left), but this occurs way more reliably on any <Select /> component as well (there, just clicking the component suffices to cause a full window freeze).

    I've managed to narrow this down to the upgrade to [email protected], which was shipped with [email protected] (i.e. using ≤4.6.4 works fine alongside zone.js).

    I believe that this is related to the usage of Resize Observer measures, which causes a Zone.js infinite loop.

    I definitely don't think this is an invalid bug / issue, as it effectively prevents from using ant-design past version 4.6.4 (and therefore also blocks upgrading to React 17) on any web-app which uses Angular (which requires zone.js) somewhere in the app.

    Please let me know if I can provide any more information.

  4. zombieJ commented on Jan 6, 2021

    @zombieJ
    Member

    @vicrep, you can fire issue to zone.js instead since we do not have magic code on ResizeObserver. It's better for zone.js to fix this loop issue.

  5. nuonuoge commented on Apr 15, 2021

    @nuonuoge

    image
    @vicrep @zombieJ It's not resize observer cause, when import zone.js the setstate never refresh value,if use settimout instead promise.resolve() will slove

  6. olivewind commented on Oct 21, 2021

    @olivewind

    实际测试下来:select + zonejs 或单独使用 rc-trigger + zonjs 会卡死。

    但是使用 popover,dropdown 等同样依赖 rc-trigger 却不会卡死,看起来比较像是 rc-select 有 bug.

  7. nopol10 commented on Jan 4, 2022

    @nopol10

    I'm developing an extension that allows the user to open an antd modal on a Twitter status page. Opening the modal the 1st time is fine but the second time will always fail on certain pages. The page also scrolls to the top when the modal opens. The patch here angular/angular#41506 (comment) seems to prevent that from happening.

  8. yanhaijing commented on Nov 5, 2022

    @yanhaijing

    react-component/trigger@017131d?diff=split
    新的rc-trigger改成了useEffect实现,测试已经不存在这个问题了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions