You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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( [] ) as onRemove to RichText, which is really strange. Semantically, this should be just onRemove, which also handles setting the selection correctly.
How has this been tested?
Screenshots
Types of changes
Checklist:
My code is tested.
My code follows the WordPress code style.
My code follows the accessibility standards.
My code has proper inline documentation.
I've included developer documentation if appropriate.
I've updated all React Native files affected by any refactorings/renamings in this PR.
It seems that some blocks are passing onReplace( [] ) as onRemove to RichText, which is really strange. Semantically, this should be just onRemove, which also handles setting the selection correctly.
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.
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?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Type] BugAn existing feature does not function as intended
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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( [] )asonRemoveto 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: