plate
plate copied to clipboard
Select half of the image then delete (backspace) broke editor
Description
Steps to Reproduce
- Select a text below the image
- Move cursor so that select half of the image (not trigger image selected state)
- Press backspace
https://github.com/udecode/plate/assets/129946813/e821d29c-1c21-4a37-a036-2fb3fff14675
Sandbox
This could be reproduce using demo editor on platejs.org
Expected Behavior
TBD
Environment
- slate: 0.94.1
- slate-react: 0.99.0
- browser: chrome 120.0.6099.216
Bounty
Click here to add a bounty via Algora.
Funding
- You can sponsor this specific effort via a Polar.sh pledge below
- We receive the pledge once the issue is completed & verified
The selection may have some wrong which look like a point should be a range, Is there someone give me some advice to fix it?
This is a bug in slate-react. Related issues: https://github.com/ianstormtaylor/slate/issues/5435, https://github.com/ianstormtaylor/slate/pull/5451.
The error occurs inside toSlatePoint
, where the anchorNode
has been passed in from toSlateRange
as a span HTMLElement instead of a Text node.
Same issue. It also happens when you select text and also an image until the drag handles show up. How can I prevent it from crashing the page?