Skip to content

Adding image from the images right inserts the image at the bottom of the post #76

@RobinEd

Description

@RobinEd

It does not insert the selected image in the block where the mouse cursor is

Root cause

The insertBlock callback in PressThisEditor was manually appending to the blocks array with setBlocks( prev => [ ...prev, block ] ), which always placed new blocks at the end regardless of cursor position. The fix (PR #79) replaces this with the block editor store's insertBlock dispatch action, called from a child component inside BlockEditorProvider, which uses getBlockInsertionPoint() to insert after the currently selected block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions