lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: Decorator node content is not rendered on sub-sequent render if the editor is behind Suspense

Open EugeneVorobyev opened this issue 1 year ago • 1 comments

When we have a combination of:

  • custom DecoratorNode
  • editor is behind Suspense then editor won't render the content of decorator node (returned by decorate) on sub-sequent renders triggered by outside.

Lexical version: 0.13.0

Steps To Reproduce

To reproduce you'd need to create a setup with Editor behind Suspense and a simple DecoratorNode

Link to code example: Here is a repository with repro: https://github.com/EugeneVorobyev/lexical-decorator-node-issue

Video

Here the testNode is a decorator node that returns 1234. As you can see on the video, in case of update that causes re-render, the content of that node won't render anymore. Though if you edit nearest node, it will appear again.

https://github.com/facebook/lexical/assets/1272788/a251890c-472e-4e12-bb39-ec8e713adf77

The current behavior

Decorator node content is not rendered

The expected behavior

Decorator node content is rendered

EugeneVorobyev avatar Jan 25 '24 20:01 EugeneVorobyev