"Maximum update depth exceeded" error in Ellipsis

#53869

Issue Details

2 months ago
Copilot
Copilot
help wanted
devkatdevkat
opened 2 months ago
Author

Edit on CodeSandbox

Steps to reproduce

  • Open the code example, wait until the error occurs.
  • The <Typography.Text> attribues "ellipsis" and "copyable" have to be set.
  • I can reproduce it consistently on Chrome and sometimes on Firefox.

What is expected?

The page is rendered correctly.

What is actually happening?

The page shows an error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

EnvironmentInfo
antd5.25.1
React19.1.0
SystemmacOS
BrowserChrome 136.0.7103.114

The error seems to be due to the ellipsis measurement algorithm. Sometimes, the algorithm needs more than 50 steps (React limit) which triggers the error. It might be related to the table layout; it only seems to occur when the description label constains spaces which allow the column content to wrap.