[RNMobile] add isSelected prop to PlainText-backed blocks#11989
Merged
[RNMobile] add isSelected prop to PlainText-backed blocks#11989
Conversation
… focus() on React Native TextInput
…ReactNative lifecycle
| export default function CodeEdit( { attributes, setAttributes, style } ) { | ||
| export default function CodeEdit( props ) { | ||
| const { attributes, setAttributes } = props; | ||
| const { style } = attributes; |
Contributor
There was a problem hiding this comment.
It seems that style should be retrieved from props.
Contributor
|
LGTM once Travis is happy. |
daniloercoli
approved these changes
Nov 16, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a follow up PR to #11857, bringing the same functionality to PlainText-backed blocks:
PlainTextimplementation to be a React Native component (so we can make use of the lifecycle events more clearly)isSelectedprop toCodeandMoreblocksBy doing this, we can make it easier to handle the focus at the low level when
isSelectedis true.How has this been tested?
To be tested as per indicated in wordpress-mobile/gutenberg-mobile#250
+inserter iconPlainTextimplementation)Screenshots
Before, the focus would not be gotten when a new "PlainText"-backed block was inserted:

Now, the cursor appears blinking after insertion:

Types of changes
Bug fix (non-breaking change which fixes an issue)