Open jason89521 opened 3 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
lexical | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 26, 2024 4:14am |
lexical-playground | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 26, 2024 4:14am |
Hi! Thanks for the contribution!
Can you pls write tests to cover this use case?
@StyleT added in c1d6ada!
@StyleT Hi, just a gentle nudge to see if you could take a moment to review this pull request when you have a chance. Thanks!
Why
I pressed
shift + ArrowLeft
at the beginning of the video, and then pressedBackSpace
to delete the selection. You can see the image node is selected, but when I deleted the selection, it didn't been deleted. Actually, the image node was not selected.At the second half of the video, I pressed
shift + ArrowRight
, the first image also showed that it was selected. However, the image node didn't been selected actually, so when I deleted the selection, the image node didn't been deleted.https://github.com/facebook/lexical/assets/47748132/8b33a6fb-f6e1-41b1-b5cd-3aded298e3d4
What
Beside checking whether the selection is collapsed, we should also check non-collapsed situation.
How
First, check whether the node is an inline decorator node.
Then check whether the anchor is before the focus.
Additional Information
After this pr:
https://github.com/facebook/lexical/assets/47748132/f3e3257b-f26d-45d4-8322-672dda184d9e