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

Blocks: Remove onFocus from core blocks' RichText usage #7029

merged 1 commit into from May 31, 2018


None yet
2 participants

aduth commented May 30, 2018

Closes #6944

This pull request seeks to remove core blocks' use of RichText onFocus, which was deprecated in 2.8 and slated for removal in 3.0. Rather than restore functionality of the onFocus prop, which would have the effect of not breaking onFocus as-promised by compatibility messaging for existing plugin use, and given that the current plan is for onFocus to not remain in its current form pending refactoring as discussed / proposed in #6871, I opted instead for a separate, private (unstable) prop name unstableOnFocus.

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?

onSelectCaption() {
if ( ! this.state.captionSelected ) {
this.setState( {
captionSelected: true,
} );
if ( ! this.props.isSelected ) {

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.

Blocks: Remove onFocus from core block's RichText
Use unstable, internal compatibility prop instead

@aduth aduth added the Blocks label May 30, 2018

@aduth aduth added this to the 3.0 milestone May 30, 2018

@aduth aduth requested review from youknowriad and gziolo May 30, 2018


Code looks great with the comment provided 👍 I need to test it when on desktop.


gziolo approved these changes May 31, 2018

Works properly

@gziolo gziolo merged commit 5673eb8 into master May 31, 2018

2 checks passed

codecov/project 46.42% (-0.02%) compared to eb4fc18
continuous-integration/travis-ci/pr The Travis CI build passed

@gziolo gziolo deleted the fix/rich-text-on-focus branch May 31, 2018

@gziolo gziolo referenced this pull request Nov 12, 2018


RichText: own undo signalling #10650

4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment