Blocks: Remove onFocus from core blocks' RichText usage #7029
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.
Closes #6944
This pull request seeks to remove core blocks' use of
RichTextonFocus, which was deprecated in 2.8 and slated for removal in 3.0. Rather than restore functionality of theonFocusprop, which would have the effect of not breakingonFocusas-promised by compatibility messaging for existing plugin use, and given that the current plan is foronFocusto not remain in its current form pending refactoring as discussed / proposed in #6871, I opted instead for a separate, private (unstable) prop nameunstableOnFocus.Testing instructions:
I don't know why these blocks use this. There are no code comments for myself, the future maintainer, to reference. I guess based on the callback handler, something about captions and block being selected?
gutenberg/core-blocks/gallery/gallery-image.js
Lines 39 to 49 in eb4fc18
Edit: Okay, I think the expected behavior we want to preserve, for gallery at least, is that clicking a caption directly without first selecting the image in the gallery causes the image in the gallery to be selected. Still not sure about image block.