PCH: Resolve cursor jump to start in Paragraph Blocks upon selection #2305
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
We've identified and resolved an issue where clicking inside paragraph blocks incorrectly positioned the cursor at the block's start, due to conditional rendering of a custom
SettingsProvider
based on the block's selection state. By adjusting our approach to consistently apply theSettingsProvider
to all paragraph blocks, we eliminated inconsistencies in the component tree, ensuring stable cursor behavior and simplifying the component's logic for enhanced reliability and maintainability.Motivation and context
This change was necessitated by a disruptive user experience issue where the text cursor would unpredictably jump to the start of paragraph blocks, hampering content editing within the Gutenberg editor. By uniformly applying the
SettingsProvider
across all paragraph blocks, we not only addressed the root cause of the cursor misplacement but also enhanced the plugin's overall stability, contributing to a smoother editing workflow.How has this been tested?
Tested locally