How can I set Character Length in react-quill. In Docs it has been given that getLength() will return the length of the character in editor..
But I am Unable to figure out How to implement it.
My JSX
<ReactQuill theme='snow'
onKeyDown={this.checkCharacterCount}
value={this.state.text}
onChange={this.handleChange}
modules={modules}
formats={formats}
//style={{height:'460px'}}
/>
// OnChange Handler
handleChange = (value) => {
this.setState({ text: value })
}
//Max VAlue checker
checkCharacterCount = (event) => {
if (this.getLength().length > 280 && event.key !== 'Backspace') {
event.preventDefault();
}
}
The Above solution i found on GitHub . But its not working...