Opened 8 years ago

Last modified 8 years ago

#14869 closed Bug

JS error thrown with Find and Divarea plugins used together. — at Version 4

Reported by: Jakub Ś Owned by:
Priority: Normal Milestone: CKEditor 4.6.2
Component: General Version: 4.0
Keywords: Support Cc:

Description (last modified by Jakub Ś)

Steps to reproduce

  1. Open sample which contains Find and Divarea plugins (divrea sample in standard package).
  2. Type New Paragraph added
  3. Open Find dialog and search for New
  4. Close the dialog with close button.

Expected result

No error is thrown.

Actual result

JS error is thrown:
Message:
Firefox: IndexSizeError: Index or size is negative or greater than the allowed amount
Chrome: IndexSizeError: Failed to execute 'setStart' on 'Range': The offset 19 is larger than or equal to the node's length (3). Line:1933
Path: ckeditor-dev/core/selection.js

Other details (browser, OS, CKEditor version, installed plugins)

Problem can be reproduced in all browsers.

Change History (4)

comment:1 Changed 8 years ago by Jakub Ś

Status: newconfirmed

comment:2 Changed 8 years ago by Jakub Ś

Keywords: Support added

comment:3 Changed 8 years ago by Jakub Ś

Based on information from user who originally reported this ticket, I have debugged this issue. It seems the problem is editor.focus(); in onHide method in find.js file.

When debuging code manually error is not thrown so a good workaround for this issue is warping editor.focus() in

CKEDITOR.tools.setTimeout( function() {
  editor.focus();
}, 0, this );

Still after calling editor.getSelection().selectRanges( [ range ] ); start/end offsets show 0/1 (not 03). In order to fix offsets you need to call editor.getSelection().getRanges()[0].moveToRange(range); but you should rather not be doing that in a first place so this is another workaround just for offsets.

comment:4 Changed 8 years ago by Jakub Ś

Description: modified (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy