Ckeditor5: New block quote appears after pressing Enter inside the empty block quote

Created on 28 Aug 2017  Â·  9Comments  Â·  Source: ckeditor/ckeditor5

Steps to reproduce

  1. Go to http://localhost:8125/ckeditor5-presets/tests/manual/article.html.
  2. Select the content inside the block quote.
  3. Press Backspace twice.
  4. Put the caret at the empty block quote.
  5. Press Enter.

Current result

New block quote appeared.

Notes

This bug is reproducible only if the image was inserted above the block quote.

GIF

bug_cke5

Other information

OS: Windows 10, MacOS X
Browser: All browsers
Release: 0.10.0

block-quote typing bug

All 9 comments

We're left with a blockquote without a paragraph inside. This may be a bug in the deleteContent()' "delete all content handling".

This is probably a regression right? I am pretty sure we have tested that scenario.

This is a new code in deleteContent() and the typing feature, so it seems to introduce a regression.

This is a new code in deleteContent() and the typing feature, so it seems to introduce a regression.

And this bug still occurs. Even if the introduced code will be disabled:

image

Hm... Surprise. I can confirm that it's old – reproducible on ckeditor5.github.io. So no pressure on fixing it – it requires pressing backspace twice and in a specific condition (when image precedes a blockquote).

It might be a bug in ckeditor5-widget's backspace handler or somewhere deep in deleteContent().

When I replace this block – https://github.com/ckeditor/ckeditor5-widget/blob/86537d84bca31b50c44b2c3a25a918c5ea44bda5/src/widget.js#L171-L174

with

if ( previousNode.isEmpty ) {
    const dataController = this.editor.data;
    const batch = modelDocument.batch();

    dataController.deleteContent( modelSelection, batch );
}

I am not able to reproduce this issue. Unfortunately, two tests fail. Here is my question – could we fix the tests or isn't my proposition valid?

And how are we supposed to answer if you haven't shown us these tests? ;)

Besides, try understanding the cause. You're talking about the code all the time, replacing one code with another. But to propose a correct solution you need to understand what should be the correct solution. Code comes next.

@Mgsy, we resolved an issue which can fix the reported bug.

Could you check it once again?

@pomek: I checked it and everything works fine, thanks. I'm closing this issue.

Was this page helpful?
0 / 5 - 0 ratings