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: Blocks: Make backspace behavior of quote, verse and performated consistent #7958

Merged
merged 1 commit into from Sep 18, 2018

Conversation

Projects
None yet
2 participants
@jorgefilipecosta
Member

jorgefilipecosta commented Jul 13, 2018

In list, heading, and paragraph if we had a paragraph before and pressed backspace the contents of the blocks would be merged with the paragraph. If we had a block of the same type before, the contents would be merged on backspace. And if had a paragraph after the block and pressed backspace there the contents of the paragraph would be appended to the contents of the block.

These behaviors make sense but on the quote, verse and performated they were not available.

This PR adds simple merge functions to each of the three blocks and passes the onMerge handler to the RichText component they use.

Fixes: #5057

How has this been tested?

For each of the 3 blocks ( quote, verse and performated ) I made the following stepts:

  • Added two blocks of the same type with some content. Pressed backspace on the second block and verified the blocks merged.
  • Added a paragrah with content and one of the blocks after pressed backspace on the start of the block and verified the contents of the block merged with the paragraph.
  • Added a block and a paragraph pressed backspace at the start of the paragraph and verified that the contents of the paragraph joined the block.
@aduth

This would be good to get in.

Show outdated Hide outdated core-blocks/preformatted/index.js Outdated
Show outdated Hide outdated packages/block-library/src/quote/index.js Outdated
@aduth

This comment has been minimized.

Show comment
Hide comment
@aduth

aduth Sep 13, 2018

Member

Oh, I should mention that I did a rebase to resolve conflicts and force-pushed.

Member

aduth commented Sep 13, 2018

Oh, I should mention that I did a rebase to resolve conflicts and force-pushed.

@jorgefilipecosta

This comment has been minimized.

Show comment
Hide comment
@jorgefilipecosta

jorgefilipecosta Sep 18, 2018

Member

Hi @aduth thank you for the review and for rebasing this old PR 👍 I applied the feedback you provided!

Member

jorgefilipecosta commented Sep 18, 2018

Hi @aduth thank you for the review and for rebasing this old PR 👍 I applied the feedback you provided!

@jorgefilipecosta jorgefilipecosta added this to the 4.0 milestone Sep 18, 2018

@aduth

aduth approved these changes Sep 18, 2018

Show outdated Hide outdated packages/block-library/src/quote/index.js Outdated
Fix: Blocks: Make backspace behavior of quote, verse and performated …
…consistent with what we had in paragraph, heading, and list.

In list, heading, and paragraph if we had a paragraph before and pressed backspace the contents of the blocks would be merged with the paragraph. If we had a block of the same type before, the contents would be merged on backspace. And if had a paragraph after the block and pressed backspace there the contents of the paragraph would be appended to the contents of the block.

These behaviors make sense but on the quote, verse and performated they were not available.

This PR adds simple merge functions to each of the three blocks and passes the onMerge handler to the RichText component they use.

@jorgefilipecosta jorgefilipecosta merged commit e0e6668 into master Sep 18, 2018

2 checks passed

codecov/project 48.77% (-0.02%) compared to bd5910b
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jorgefilipecosta jorgefilipecosta deleted the fix/make-backspace-consistent-on-quote-verse-preformated branch Sep 18, 2018

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