-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fixed issue with re-focusing PostTitle #14969
Fixed issue with re-focusing PostTitle #14969
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -681,7 +681,7 @@ const RichTextContainer = compose( [ | |||
return { | |||
clientId: context.clientId, | |||
isSelected: context.isSelected, | |||
onFocus: context.onFocus, | |||
onFocus: context.onFocus ? context.onFocus : ownProps.onFocus, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the ownProps.onFocus take precedence maybe? That's the callback set by the parent component, right? If so, my guess would be that it should override the internal callback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure of the usage of context
at that point to be honest. I didn't have time to investigate it properly last Friday.
It seems to me that this return
will be executed if isSelected
is undefined. And that will happen (probably) only on elements that are not blocks (like the PostTitle?). If that the case, maybe it's good to return ownProps
directly?
I'm not sure of any of this, but this proposed solution fixes the bug on the release branch. Good thing is that there is time to think on a better solution. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure of the usage of context at that point to be honest. I didn't have time to investigate it properly last Friday.
👍 cool, no problem. Let's keep working on this one then to get to the bottom of it. @marecar3, I think Eduardo will not be available the next couple of days so please, feel free to dig into this one some more. Thanks!
Closing in favor of #15069 |
Fixes: wordpress-mobile/gutenberg-mobile#865
Corresponding gutenberg-mobile PR : #14969