Skip to content

Got "Uncaught DOMException: Failed to execute 'setEnd' on 'Range'" when operating on a mention #2256

Description

@dsidharta

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Open https://sdk.ckeditor.com/samples/mentions.html.
  2. Make sure that the developer console is open.
  3. Mention one of the users, say, "@ ajames" (without the space).
  4. Delete the mention added in step 3 one character at a time.

May need to repeat steps 3 and 4 multiple times for the Exception to happen.

Expected result

No errors in developer console.

Actual result

Got the following errors:

Uncaught DOMException: Failed to execute 'setEnd' on 'Range': The offset 6 is larger than the node's length (5).
at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.range.getClientRects (https://sdk.ckeditor.com/vendor/ckeditor/4.10.0/ckeditor.js:187:3)
at getViewPosition (https://sdk.ckeditor.com/vendor/ckeditor/4.10.0/plugins/autocomplete/plugin.js?t=I6D6:14:470)
at g.updatePosition (https://sdk.ckeditor.com/vendor/ckeditor/4.10.0/plugins/autocomplete/plugin.js?t=I6D6:18:76)
at f.viewRepositionListener (https://sdk.ckeditor.com/vendor/ckeditor/4.10.0/plugins/autocomplete/plugin.js?t=I6D6:11:217)
at f. (https://sdk.ckeditor.com/vendor/ckeditor/4.10.0/plugins/autocomplete/plugin.js?t=I6D6:9:107)
at a.h (https://sdk.ckeditor.com/vendor/ckeditor/4.10.0/ckeditor.js:10:70)
at a. (https://sdk.ckeditor.com/vendor/ckeditor/4.10.0/ckeditor.js:11:433)
at a.window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire (https://sdk.ckeditor.com/vendor/ckeditor/4.10.0/ckeditor.js:13:97)
at CKEDITOR.plugins.undo.UndoManager.type (https://sdk.ckeditor.com/vendor/ckeditor/4.10.0/ckeditor.js:1079:373)
at CKEDITOR.plugins.undo.NativeEditingHandler.onKeyup (https://sdk.ckeditor.com/vendor/ckeditor/4.10.0/ckeditor.js:1090:121)

Other details

  • Browser: Chrome, Safari

Metadata

Metadata

Assignees

No one assigned

    Labels

    browser:chromeThe issue can only be reproduced in the Chrome browser.browser:safariThe issue can only be reproduced in the Safari browser.plugin:mentionsThe plugin which probably causes the issue.resolution:duplicateA duplicate of an already reported issue.status:confirmedAn issue confirmed by the development team.target:minorAny docs related issue that can be merged into a master or major branch.type:bugA bug.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions