Bug: Inconsistent behavior of `trimTextContentFromAnchor` on paste
Open
all-platforms-bug
other
- Dominant language
- TypeScript
- Stars
- 23.9k
- Forks
- 2.2k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 55
Description
Lexical version: 0.7.6
## Steps To Reproduce
1. Open Lexical Playground with the "Max Length" setting on: https://playground.lexical.dev/?isMaxLength=true
2. Clear the editor
3. Paste some text longer than 30 character (the max length enforced with `MaxLengthPlugin` in Lexical Playground)
4. Clear the editor
5. Type any character, then repeat step 3.
At step 3. the pasted text is truncated at the maximum length.
At step 5. no text is pasted. `trimTextContentFromAnchor` reverts to the previous editor state.
My intuition is that the behavior at step 3. is correct.
Contributor guide
Assessment
This issue has not been assessed yet.