ant-design/ant-design

Popover remains visible when component tree is suspended

Open

#38,158 opened on Oct 21, 2022

View on GitHub
 (5 comments) (0 reactions) (0 assignees)TypeScript (98,031 stars) (54,612 forks)batch import
Inactivehelp wanted

Description

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. Open Popover by clicking on the Open Popover button
  2. Trigger suspense by clicking on the popover content button Hide and load data
  3. See popover remaining visible while the component tree is suspended.

What is expected?

The popover to be hidden.

What is actually happening?

The popover remains visible.

Environment Info
antd 4.23.6
React 17
System Linux
Browser Google Chrome

React.Suspense provide a lifecycle so components can handle the display:none removal. This can be used to handle this: https://github.com/facebook/react/issues/14536

Contributor guide