-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writing Flow: fix reverse selection after block deletion from rich text #22292
Conversation
Size Change: +18 B (0%) Total Size: 827 kB
ℹ️ View Unchanged
|
I suspect that a bunch of blocks are doing it that way because one block did it that way first, and all the other blocks just copied the approach, so now doing it that way appears to be correct because all the other blocks do it that way. |
Do you think we can treat the onReplace([]) exactly like onRemove on the reducer level (update selection)? |
The selection doesn't happen in the reducer, but rather in the action. I guess we could add it in the replace action? |
or maybe forward the replace action to the "remove" one if the array is empty. Also, I'm wondering if we need to update the selection if the array is not empty and if the behavior there should be different? |
Description
See also #22290.
Currently, when you press Backspace in an empty paragraph that is preceded by an image block (for example), the caret selection ends up at the last text field (caption) but not at end of that field.
It seems that some blocks are passing
onReplace( [] )
asonRemove
to RichText, which is really strange. Semantically, this should be justonRemove
, which also handles setting the selection correctly.How has this been tested?
Screenshots
Types of changes
Checklist: