Bug type
Crash (process/app exits or hangs)
Browser surface
Yes
Summary
When using a maxLength constraint and pasting text longer than the constraint with multiple line-breaks in the overflowing text the app breaks.
Public reproduction URL
https://plate-playground-template-red.vercel.app/editor
Steps to reproduce
- Use reproduction URL and/or check commit)
- Paste text with 20+ chars where two line-breaks are after the cut-off of 20 (see example payloads in provided link)
- App crashes
Expected behavior
The app would not crash
Actual behavior
The app crashes with the below error message in console.
Uncaught TypeError: Cannot read properties of undefined (reading 'text')
Uncaught TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
Acceptance criteria
- multiple linebreaks in pasted text do not break the app
Plate / Slate / React versions
Operating system
NOT_ENOUGH_INFO
Install method
No response
Framework / app setup
NOT_ENOUGH_INFO
Affected packages or entry points
NOT_ENOUGH_INFO
Minimal code or config excerpt
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response
Bug type
Crash (process/app exits or hangs)
Browser surface
Yes
Summary
When using a
maxLengthconstraint and pasting text longer than the constraint with multiple line-breaks in the overflowing text the app breaks.Public reproduction URL
https://plate-playground-template-red.vercel.app/editor
Steps to reproduce
Expected behavior
The app would not crash
Actual behavior
The app crashes with the below error message in console.
Acceptance criteria
Plate / Slate / React versions
Operating system
NOT_ENOUGH_INFO
Install method
No response
Framework / app setup
NOT_ENOUGH_INFO
Affected packages or entry points
NOT_ENOUGH_INFO
Minimal code or config excerpt
NOT_ENOUGH_INFOLogs, screenshots, and evidence
Impact and severity
No response
Additional information
No response