Skip to content

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

@softaria-roman

Description

@softaria-roman

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions