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: Shortcut inserter on invalid paragraphs #9613

Merged
merged 1 commit into from Sep 6, 2018

Conversation

Projects
None yet
2 participants
@jorgefilipecosta
Member

jorgefilipecosta commented Sep 4, 2018

Description

On invalid paragraph blocks (that don't show the paragraph UI) we still had the shortcut inserter and the side inserter showing but as the background was not a paragraph the design looked wrong and made hard to click on the sibling menu of invalid blocks.
This PR's makes sure we don't show shortcut & side inserter on invalid paragraphs making the way we handle invalid paragraphs equal to how we handle all other invalid blocks.
Besides that, we show the DefaultBlockAppender even if the last block was an invalid paragraph (again to have the same behavior that we have for other invalid blocks).

How has this been tested?

I added the following content in the editor:

<!-- wp:paragraph -->
<sdsp>/dsf</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<sdsp>/dsf</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<psd>sdfds</p>
<!-- /wp:paragraph -->

And checked that the shortcuts/side inserter only appear when they should.

Screenshots

Before:
image

After:
image

@jorgefilipecosta jorgefilipecosta requested review from WordPress/gutenberg-core and johngodley Sep 6, 2018

@tofumatt

Makes sense to me. Might be a good one for an E2E test we could add to, for testing what should/shouldn't appear when blocks are invalid.

@tofumatt

That was meant to be an "approving" PR, sorry; clicked the wrong thing.

@jorgefilipecosta jorgefilipecosta merged commit 735ab8d into master Sep 6, 2018

2 checks passed

codecov/project 50.37% (-0.01%) compared to ef25165
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jorgefilipecosta jorgefilipecosta deleted the fix/sibling-inserter-on-invalid-paragraphs branch Sep 6, 2018

@jorgefilipecosta

This comment has been minimized.

Show comment
Hide comment
@jorgefilipecosta

jorgefilipecosta Sep 6, 2018

Member

Thank you for the review @tofumatt. I will look into adding some end 2 end test to these behaviors.

Member

jorgefilipecosta commented Sep 6, 2018

Thank you for the review @tofumatt. I will look into adding some end 2 end test to these behaviors.

@jorgefilipecosta jorgefilipecosta modified the milestone: 3.9 Sep 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment