Skip to content

Block API: Block splitting, insert after #375

@aduth

Description

@aduth

Related: #374
Slack discussion: https://wordpress.slack.com/archives/C02QB2JS7/p1491308809656882 (cc @spocke)

With current block APIs, we might be able to support this by passing additional callbacks to the edit render handler, e.g. insertBlockAfter.

Proposal:

insertBlockAfter( block: ?WPBlock )
  • If passed null, inserts empty block after currently selected block
  • If passed block, appends block after currently selected block
    • How does a block implementation know how to create a block node? Should we overload this to support passing e.g. markup string?

In all cases, moves cursor focus to start of newly inserted block.

Metadata

Metadata

Assignees

Labels

FrameworkIssues related to broader framework topics, especially as it relates to javascript[Type] TaskIssues or PRs that have been broken down into an individual action to take

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions