0

With the DraftJS editor in readOnly mode, I would like to add the ability to show just a few lines of the editor content, with a link to show all, then a link to show less again.

I have no idea where to start. Can you point me to a direction to follow ?

Thanks in advance.

acmoune
  • 2,981
  • 3
  • 24
  • 41

1 Answers1

0

My first thought, as someone fairly new to draftjs:

You need to somehow listen for the click event on the show all/show less button, and then have a less entity and an all entity that are styled differently based on the status of that button being clicked or not, maybe also conditionally append some ellipses, etc.

Basically look into manipulating entities to do what you want.

z0d14c
  • 1,122
  • 1
  • 12
  • 20