Replies: 2 comments
-
|
Hey- not sure if you got around your problem, but i got it working by creating custom plugin based on and passing the maxLength as prop to the rich text editor |
Beta Was this translation helpful? Give feedback.
-
|
I got it working. My deps are: "@lexical/react": "^0.33.1"
"lexical": "^0.33.1",imports: import { OverflowNode } from '@lexical/overflow';
import { CharacterLimitPlugin } from '@lexical/react/LexicalCharacterLimitPlugin';
let initialConfig = {
namespace: 'Editor',
theme,
onError,
nodes: [OverflowNode],
editable: !disabled,
};Add the plugin inside <CharacterLimitPlugin maxLength={maxLength} />You can also pass a custom renderer. You can refer for the usage here: https://github.com/facebook/lexical/blob/main/packages/lexical-react/src/LexicalCharacterLimitPlugin.tsx#L55 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
hello,
ive seen that a MaxLengthPlugin has been added here #2254 but in my project I cannot import it. the package json states following dependencies:
"lexical": "^0.11.3",
"@lexical/react": "^0.11.3",
what I'm I doing wrong?
thanks and best
Beta Was this translation helpful? Give feedback.
All reactions