Opened 9 years ago

Closed 8 years ago

#12813 closed Bug (invalid)

Cannot select widget on readonly editor in IE11

Reported by: Pawel Pecio Owned by:
Priority: Normal Milestone:
Component: Core : Selection Version: 4.3
Keywords: IE Cc:

Description

User cannot select widget on Internet Explorer browsers (I've experienced this problem on IE11, but probably all IE versions are affected) if editor is in readonly mode.

Steps to reproduce:

  1. Go to CKEditor Demo page > Widgets
  2. Set main editor (CKEDITOR.instances.editor1) to readonly by setReadOnly(true)
  3. Main editor becomes grayed
  4. Try to select widget by clicking the widget border (not inside header or content - see attached screenshot). Internet Explorer should throw Unspecified error exception on sel.addRange(nativeRange) at the end selectRanges function.

I've investigate this problem. This bug occurs because range object container is an hidden element (display: none) and is not editable (contentedtiable=false). I don't know why IE throws an exception in this case, but it seems that not visible text cannot be selected.

This exception is a result of creating fake selection by widget. The fake() function from selection.js calls hideSelection function in which hiddenEl is created. In IE this element has display=none style (why? - in other browsers it is places out of the page content). If editor is read-only, hiddenEl is appended to the element that has contenteditable=false (so hiddenEl itself is also not editable), in conjunction with display=none it causing the exception during sel.selectRanges() call.

Proposed fix: do not set display=none for <div data-cke-hidden-sel="1" data-cke-temp="1"> element for IE (hide it in different way, maybe visibility property?, reposition by absolute positioning?) OR add contenteditable=true to the DIV. The exception is thrown only for both display=none and contenteditable=false properties set.

Version 4.4.6 is affected, probably olders too.

Attachments (1)

Zrzut ekranu z 2015-01-13 18:11:58.png (109.0 KB) - added by Pawel Pecio 9 years ago.
Screenshot with the exception

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by Pawel Pecio

Screenshot with the exception

comment:1 Changed 9 years ago by Jakub Ś

Keywords: IE added
Status: newconfirmed
Version: 4.4.64.3

I have been able to reproduce this issue in IE8-11 from CKEditor 4.3.

IE8 reports error 800a025e while all others report error SCRIPT16389.

comment:2 Changed 8 years ago by Jakub Ś

Resolution: invalid
Status: confirmedclosed

This issue is in fact a duplicate of #12134 and widgets should not be selectable or even focusable in readOnly mode.

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