Skip to content

Avoid sending onEnter when AztecView is not focused.#1065

Merged
etoledom merged 2 commits intodevelopfrom
issue/1063-focus-look-pressing-enter-on-title
Jun 5, 2019
Merged

Avoid sending onEnter when AztecView is not focused.#1065
etoledom merged 2 commits intodevelopfrom
issue/1063-focus-look-pressing-enter-on-title

Conversation

@etoledom
Copy link
Copy Markdown
Contributor

@etoledom etoledom commented Jun 4, 2019

fixes #1063
fixes wordpress-mobile/WordPress-iOS#11583

The issue happens when the blur event takes longer to get to the native side than the second Enter. When this happens, a second onEnter -> onSplit chain of events is fired while the first one is still occurring. This seems to be confusing for the gutenberg store.

This doesn't happen on Android because of this:

if ( Platform.OS == 'ios' ) {
this._onPress(event);
}

On Android the focus-blur loop is broken there, but on iOS this is needed to solve this issue #784

To test:

  • Run the example project from develop on the oldest/slowest device available
  • Try to reproduce the original bug:
    • Focus on the title
    • Press Enter two or more times fast
    • See the focus loop happening
  • Checkout this branch.
  • Try to reproduce the issue.
  • Hopefully it won't happen anymore.

Update release notes:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

@etoledom etoledom added the bugfix label Jun 4, 2019
@etoledom etoledom added this to the v1.7 milestone Jun 4, 2019
@etoledom etoledom requested a review from SergioEstevao June 4, 2019 15:19
@etoledom etoledom self-assigned this Jun 4, 2019
Copy link
Copy Markdown
Contributor

@SergioEstevao SergioEstevao left a comment

Choose a reason for hiding this comment

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

Working great! Thanks for this fix!

@etoledom etoledom merged commit 75bf025 into develop Jun 5, 2019
@etoledom
Copy link
Copy Markdown
Contributor Author

etoledom commented Jun 5, 2019

Thank you !

@etoledom etoledom deleted the issue/1063-focus-look-pressing-enter-on-title branch June 5, 2019 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS: Focus loop after pressing Enter fast on the post title Bug: Keyboard Flickering

2 participants