fix(richtext): improvement to the Rich Text Editor #5446 (#5897)

This commit is contained in:
Kolja Markwardt 2021-10-28 16:45:27 +02:00 committed by GitHub
parent f80c07da27
commit 06c7e251ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -25,6 +25,17 @@ describe('Markdown widget', () => {
<p></p>
`);
});
it('moves to previous block when no character left to delete', () => {
cy.focused()
.type('foo')
.enter()
.clickHeadingOneButton()
.type('a')
.backspace({times: 2})
.confirmMarkdownEditorContent(`
<p>foo</p>
`);
});
it('does nothing at start of first block in document when non-empty and non-default', () => {
cy.focused()
.clickHeadingOneButton()

View File

@ -15,7 +15,7 @@ function CloseBlock({ defaultType }) {
return next();
}
if (startBlock.type !== defaultType) {
return editor.setBlocks(defaultType);
editor.setBlocks(defaultType);
}
return next();
},