Open Nonsmokers opened 2 years ago
function lengthLimit(tr: Transaction): boolean {
return (tr.startState?.doc?.length + tr.newDoc.length) < 200;
}
function lengthLimit(tr: Transaction): boolean { return (tr.startState?.doc?.length + tr.newDoc.length) < 200; }
Thanks for the answer, works correctly, but if you insert a value and it is more than the given limit (for example: 97 characters entered and paste 4 characters -> 101/100), the editor becomes uneditable.
Hello! Thanks for this great project!
It's not so clear how to set a limit on the number of characters entered? Isn’t there any built-in solution? Simple example: https://codesandbox.io/s/react-codemirror-example-codemirror-6-forked-kylrmk?file=/src/App.tsx
Thanks a lot.