Fixed issue with re-focusing PostTitle#14969
Fixed issue with re-focusing PostTitle#14969marecar3 wants to merge 1 commit intornmobile/release-v1.2.1from
Conversation
| clientId: context.clientId, | ||
| isSelected: context.isSelected, | ||
| onFocus: context.onFocus, | ||
| onFocus: context.onFocus ? context.onFocus : ownProps.onFocus, |
There was a problem hiding this comment.
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.
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.
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