Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block API: Block splitting, insert after #375

Closed
aduth opened this issue Apr 6, 2017 · 2 comments
Closed

Block API: Block splitting, insert after #375

aduth opened this issue Apr 6, 2017 · 2 comments
Assignees
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@aduth
Copy link
Member

aduth commented Apr 6, 2017

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.

@aduth aduth added Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Task Issues or PRs that have been broken down into an individual action to take labels Apr 6, 2017
@mtias
Copy link
Member

mtias commented Apr 11, 2017

In the context of the inserter, I was thinking we may want to have an action for insert block that is capable of handling any insertion position within the list of blocks in state.

@youknowriad
Copy link
Contributor

Closing since this is already done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

3 participants