Skip to content
This repository was archived by the owner on Jul 9, 2026. It is now read-only.

isSelected handling on PlainText-backed blocks - #250

Merged
mzorz merged 2 commits into
masterfrom
try/add-is-selected-plain-text
Nov 16, 2018
Merged

mzorz merged 2 commits into
masterfrom
try/add-is-selected-plain-text

Conversation

@mzorz

@mzorz mzorz commented Nov 16, 2018 •

Copy link
Copy Markdown
Contributor

Fix #113

This updates the GB hash to use the isSelected prop as an indication for the PlainText-backed blocks (currently the More and Code blocks) to gain focus when such a prop is true.

Related Gutenberg PR: WordPress/gutenberg#11989

Before, the focus would not be gotten when a new "PlainText"-backed block was inserted:
cursor_after_insert_okno

Now, the cursor appears blinking after insertion:
cursor_after_insert_ok

To test:

  1. make sure to select a block (tap on a block and see the up/down arrows appear, etc)
  2. now tap on the + inserter icon
  3. choose one of Code or More blocks (the only ones that currently are backed by PlainText implementation)
  4. observe the new block is inserted, the block is shown as selected (it has the up/down arrows and such) and the cursor starts blinking there (that is, it got the focus).

@daniloercoli

Copy link
Copy Markdown
Contributor

LGTM once the companion Gutenberg PR is merged.

@mzorz
mzorz merged commit d6adf44 into master Nov 16, 2018
@mzorz
mzorz deleted the try/add-is-selected-plain-text branch November 16, 2018 18:17
@mzorz
mzorz restored the try/add-is-selected-plain-text branch November 17, 2018 15:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

[Type] Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants