RIP21 / react-simplemde-editor

React wrapper for simplemde (easymde) markdown editor

Home Page:https://react-simplemde-edtior.netlify.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enforce maxLength attribute

tiotdev opened this issue · comments

It would be great if passing a maxLength attribute would work like in a textarea.
This does not work:

<SimpleMde
value={description}
onChange={handleDescriptionChange}
maxLength={1000}
/>

Is there any way currently to enforce the max length?

If it's controlled, you can control it with a code.

But I would recommend you to look at easy mde original documentation and see if this is supported there and if so, just pass right options.

This is a lightweight wrapper on top of easy mde, there is no plans to add anything on top of what easy mde already does.

Thank you!

I got it working by using getCodemirrorInstance and modifying the codemirror instance with this code Ionaru/easy-markdown-editor#254

Glad I was able to point you to the right direction :)