0

My editor is split into seperate "sections" eg

  • History
  • Examination
  • Results
  • Evaluation

which are edited seperately and different semantics (content type) affects functionality inside. Each section would be designated by Header (section title) and Content eg

History

...text here...

Examination

...text here...

The header has to be readonly so that it's content is not editable and header element itself can never be removed.

How would I implement this in draft.js?

David Thorisson
  • 1,033
  • 1
  • 11
  • 18

1 Answers1

0

A simple solution would be to use several draft instances. This does, however mean that they will have separate undo/redo stacks and copy/paste may not work as you expect.

The alternative solution would be to try to protect the headings, but it would require a lot of work, since you'd have to not only intercept when the user types normally, but also copy/paste and various other things.

mzedeler
  • 4,177
  • 4
  • 28
  • 41