Skip to content

Commit

Permalink
Add a better comment explaining why onFocus is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloercoli committed Dec 4, 2018
1 parent 423c61c commit 605962f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/AztecView.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ class AztecView extends React.Component {
onHTMLContentWithCursor = { this._onHTMLContentWithCursor }
onSelectionChange = { this._onSelectionChange }
onEnter = { this._onEnter }
onFocus = { () => {} } // Do nothing here, the onPress takes care of everything
// IMPORTANT: the onFocus events are thrown away as these are handled by onPress() in the upper level.
// It's necessary to do this otherwise onFocus may be set by `{...otherProps}` and thus the onPress + onFocus
// combination generate an infinite loop as described in https://github.com/wordpress-mobile/gutenberg-mobile/issues/302
onFocus = { () => {} }
onBlur = { this._onBlur }
onBackspace = { this._onBackspace }
/>
Expand Down

0 comments on commit 605962f

Please sign in to comment.