Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown editor refreshes automatically and looses all its content (known Slate bug) #7047

Open
softaria-roman opened this issue Jan 19, 2024 · 0 comments
Assignees
Labels
area: extensions/widgets/markdown type: bug code to address defects in shipped code

Comments

@softaria-roman
Copy link

softaria-roman commented Jan 19, 2024

Slate editor (markdown editor) refreshes automatically and looses all its content

Then it shows following error:

telegram-cloud-photo-size-2-5285022842334861576-y

Which reason is described here:

ianstormtaylor/slate#4081

Also it describes a workaround (I provided it below)

To Reproduce

Just use the markdown editor for more that 10-15 minutes.

Expected behavior

The editor does not refresh itself

Applicable Versions:

  • Decap CMS version: [3.0.12]
  • Git provider: [GitHub]
  • OS: [any]
  • Browser version [any]

Additional context

You have useMemo call at line 98 here:

https://github.com/decaporg/decap-cms/blob/master/packages/decap-cms-widget-markdown/src/MarkdownControl/VisualEditor.js

It should be replaced with useRef or at least useState as stated there:

ianstormtaylor/slate#4081 (comment)

@softaria-roman softaria-roman added the type: bug code to address defects in shipped code label Jan 19, 2024
@martinjagodic martinjagodic changed the title Decap CMS suffers from the bug in Slape editor (for which the workaround is known) Markdown editor refreshes automatically and looses all its content (known Slate bug) Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: extensions/widgets/markdown type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

3 participants