How to set maxLength in CkEditor 5 in react js?

Viewed 2961

How to set maxLength in CKEditor in react js.

I need to set max length character of the ckeditor text area

Does anyone give some examples?

return <CKEditor
    data={data.substring(0, maxLength)}
    editor={ ClassicEditor }
    config={editorConfiguration()}
    maxLength={10}>
2 Answers
<input
                        maxLength="9"
                        name="phone_number"
                        type="number"
                        onInput = {(e) =>{
                            e.target.value = Math.max(0, parseInt(e.target.value) ).toString().slice(0,9)
                          }} 
                        placeholder="მობ.ნომერი"
                        value={values.phone_number || ""}
                        onChange={handleChange}
                    />

use onInput cause maxLength doesn't work for number type

Related