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

Some ranges throw error when calling deleteContents(true) #3041

Open
engineering-this opened this issue Apr 9, 2019 · 1 comment
Open

Some ranges throw error when calling deleteContents(true) #3041

engineering-this opened this issue Apr 9, 2019 · 1 comment
Labels
core The issue is caused by the editor core code. status:confirmed An issue confirmed by the development team. type:bug A bug.

Comments

@engineering-this
Copy link
Contributor

engineering-this commented Apr 9, 2019

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Open https://codepen.io/jacekbogdanski/pen/XWEygOX
  2. Open browser console.
  3. Press button below editor.

Expected result

Editor content is removed.

Actual result

Error thrown

pen.js:13 TypeError: Cannot read property 'insertBefore' of null
    at CKEDITOR.dom.element.insertAfter (ckeditor.js:76)
    at h (ckeditor.js:149)
    at d (ckeditor.js:151)
    at CKEDITOR.dom.range.deleteContents (ckeditor.js:155)
    at CKEDITOR.dom.element.<anonymous> (pen.js:11)
    at CKEDITOR.dom.element.p (ckeditor.js:10)
    at CKEDITOR.dom.element.fire (ckeditor.js:12)
    at HTMLButtonElement.<anonymous> (ckeditor.js:68)

Other details

This is reproducible, when below criteria are met:

  • There are at least two elements in editable
  • Range starts at offset 0 in editable
  • Range ends at last possible offset of last editable child
  • Browser: Any
  • OS: Any
  • CKEditor version: Found in 4.11.4
  • Installed CKEditor plugins: image2
@engineering-this engineering-this added type:bug A bug. status:confirmed An issue confirmed by the development team. core The issue is caused by the editor core code. labels Apr 9, 2019
@engineering-this
Copy link
Contributor Author

Extracted from #2517 (comment)

@engineering-this engineering-this changed the title some ranges throw error when calling deleteContents(true) Some ranges throw error when calling deleteContents(true) Apr 9, 2019
@engineering-this engineering-this self-assigned this Apr 9, 2019
@engineering-this engineering-this removed their assignment Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core The issue is caused by the editor core code. status:confirmed An issue confirmed by the development team. type:bug A bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant