ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Creating a codeblock via backticks on some keyboard layouts causes TypeError: Cannot read properties of null (reading 'parent')

Open eliandoran opened this issue 5 months ago • 2 comments

📝 Provide detailed reproduction steps (if any)

  1. On Windows, set up the US International keyboard layout (not the standard US one).
  2. Go to https://ckeditor.com/ckeditor-5/demo/feature-rich/
  3. Type three backticks to open a code block (```).
  4. Observe the logs for an error.

✔️ Expected result

Inserting the code block via the auto-formatting should not cause any exceptions.

❌ Actual result

An unexpected error is triggered:

ck-demo-external-fea…293eec72de.js:15999 
 Uncaught CKEditorError: unexpected-error
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-unexpected-error
Original error: TypeError: Cannot read properties of null (reading 'parent')
    at hg.findMappedViewAncestor (ck-demo-external-fea…72de.js:16002:27714)
    at hg.<anonymous> (ck-demo-external-fea…72de.js:16055:41843)
    at hg.fire (ck-demo-external-fea…c72de.js:16000:1669)
    at hg.toModelPosition (ck-demo-external-fea…72de.js:16002:27163)
    at hg.toModelRange (ck-demo-external-fea…72de.js:16002:26957)
    at ck-demo-external-fea…2de.js:16020:104647
    at Array.map (<anonymous>)
    at Object.<anonymous> (ck-demo-external-fea…2de.js:16020:104638)
    at Object.fire (ck-demo-external-fea…c72de.js:16000:1669)
    at So (ck-demo-external-fea…72de.js:16000:80780)

📃 Other details

  • Browser: Edge
  • OS: Windows 11
  • First affected CKEditor version: 46.0.0
  • Installed CKEditor plugins: Happens in vanilla too.

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

eliandoran avatar Aug 01 '25 21:08 eliandoran

Please ckeditor folks, have a look at this bug. Ckeditor eating my data is one of those scenarios that makes mad. Happens when the backticks are typed fast.

deajan avatar Dec 07 '25 10:12 deajan

cc. @Witoso

Let us know if additional information is needed.

eliandoran avatar Dec 07 '25 10:12 eliandoran