[Mobile] Fix caret position after inline paste - Update.#14957
[Mobile] Fix caret position after inline paste - Update.#14957
Conversation
There was a problem hiding this comment.
Hey @mkevins, nice fix here :)
I tried both on iOS and Android and it's working like expected.
I have found some issue, which I think isn't related to this PR and maybe we already have raised it.
On iOS, when you paste the content e.g. Hello World, Hello will lose bold style after the paste, however on Android that isn't a case, so I can assume that Android is working as expected and iOS not ?
|
Note: @mkevins maybe it would be good to add Label: Component Mobile to this PR. |
|
Thank you @marecar3 . I've added [Component] Mobile label, and one for paste as well. |
I don't recall that one, but it could be. I don't yet have an iOS device to test on, but will soon. I wonder if it could be related to styles set on inline span tags. I remember a known issue about some loss of styles around that, so it could be related. |

Note
This is an addendum to #14893 as "concurrent" changes in #14820 made the previous patch inert.
Specifically, the flag
needsSelectionUpdatewas moved fromstatetothisso that it could be toggled false in therendermethod without triggering an additional render. More details here: https://github.com/WordPress/gutenberg/pull/14820/files#r274915836 .Description
This PR fixes part of this issue: wordpress-mobile/gutenberg-mobile#828 , specifically, when inline content is pasted.
How has this been tested?
This has been tested using the steps here:
wordpress-mobile/gutenberg-mobile#828 (comment)
Screenshots
Types of changes
This is a bug fix, but currently only resolves a part of the original issue. It serves as an incremental improvement.
Checklist: