Skip to content
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
merged 1 commit into from
May 31, 2018

Conversation

aduth
Copy link
Member

@aduth 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 ) {
this.props.onSelect();
}
}

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.

Use unstable, internal compatibility prop instead
@aduth aduth added the [Feature] Blocks Overall functionality of 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 20:32
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants