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

Fix: Sibling inserter adds block in the wrong position if a block is selected #14107

Conversation

jorgefilipecosta
Copy link
Member

If an empty paragraph block was selected the sibling inserter inserted the block at the position where the empty paragraph block was instead of inserting in the position the sibling inserter is being rendered.

Fixes: #14087
props to @pilou for reporting this issue.

How has this been tested?

I created 4 empty paragraph blocks, with an empty gallery and an image after.
I selected one of the empty paragraph blocks.
I passed the mouse over the image and made the sibling inserter appear between the gallery and the image block.
I added the latest posts block using the sibling inserter and I verified the block was added in the middle of the gallery and the image as expected.

Screenshots

Before:

feb-25-2019 21-38-42

After:
feb-25-2019 21-33-33

@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended [Feature] Inserter The main way to insert blocks using the + button in the editing interface labels Feb 25, 2019
rootClientId,
} = getInsertionPoint();
if (
! isAppender &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is probably useless now.

@gziolo gziolo added this to the 5.3 (Gutenberg) milestone Mar 11, 2019
@jorgefilipecosta
Copy link
Member Author

The changes did in #14020 also solved the bug this PR was intended to solve. I'm closing this PR as it is not needed anymore.

@jorgefilipecosta jorgefilipecosta deleted the fix/sibling-inserter-inserts-at-wrong-position-if-a-block-is-selected branch March 14, 2019 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants