#14407 closed Bug (fixed)
Non-editable widgets can be edited in IE
Reported by: | pollyfahey | Owned by: | Tade0 |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.7.0 |
Component: | General | Version: | |
Keywords: | Cc: |
Description
Steps to reproduce
- Add custom table widget as attached.
- In editor add table.
- Click on the bottom border of the widget and type.
Expected result
The text should be added underneath the widget.
Actual result
The text is added in the widget.
Other details (browser, OS, CKEditor version, installed plugins)
Observed in IE 11. Using CKEditor 4.5.3. Windows 10.
Attachments (3)
Change History (20)
Changed 9 years ago by
Changed 9 years ago by
Attachment: | testtable.zip added |
---|
comment:1 Changed 9 years ago by
Milestone: | → CKEditor 4.6.0 |
---|---|
Status: | new → confirmed |
comment:2 Changed 8 years ago by
Milestone: | CKEditor 4.6.0 → CKEditor 4.6.1 |
---|
comment:3 Changed 8 years ago by
Milestone: | CKEditor 4.6.1 → CKEditor 4.7.0 |
---|
We won't be able to contain it within 4.6.1 - moving to next major release.
comment:4 Changed 8 years ago by
Owner: | set to Tade0 |
---|---|
Status: | confirmed → assigned |
comment:5 Changed 8 years ago by
I noticed that after creating that widget and adding the attribute contenteditable="false"
to some of its elements it's still possible to edit them.
comment:6 Changed 8 years ago by
Status: | assigned → review |
---|
Given that what is happening here is something, that should be impossible I went with a solution that covers this specific case.
Changes pushed to branch:t/14407.
comment:7 Changed 8 years ago by
Status: | review → review_failed |
---|
Test is not working at all – it seems that it tries to load nonexistent plugins. After removing these imports, there is no way to add widget into editable. Apart from that test could be moved into tests/plugins/widget
.
After dealing with the test I noticed that I still could insert something into noneditable widget:
- Move into the widget using Up Arrow.
- Immediately after moving into it, press any character key.
The letter appears at the beginning of the widget.
comment:8 Changed 8 years ago by
Apparently in this case IE11 in Windows 7 behaves differently than IE11 in Windows 10.
comment:9 Changed 8 years ago by
There's one solution, but it isn't pretty:
For now, a selection check is done on keyup
with a timeout(cited reason was performance, but that was in 2011, so it probably doesn't apply now). Adding the same check on keydown
solves this particular problem, but breaks several tests.
Currently trying to determine why does it do that and is it significant enough to justify not going with this solution.
comment:10 Changed 8 years ago by
Improving the selection check so that it doesn't touch nested editables within non-editable elements solved most of the problems, but there still remain tests that report an Unspecified error
, which is troubling.
comment:11 Changed 8 years ago by
Status: | review_failed → review |
---|
In hindsight it wasn't a good idea to do manipulate the selection in the selection change handler - not that it didn't work.
Apparently in order not to break e.g. link handling in read-only elements it's better not to do that.
As a last resort measure I'm letting the user place the caret inside the non-editable element, but once a key is pressed the event gets prevented and the whole element is selected.
I put the unit tests in core/selection
, because the change applies not only to widgets, but also any other read-only elements. Also, the changes were made in core/selection.js
only.
Changes pushed to branch:t/14407.
comment:12 Changed 8 years ago by
Status: | review → review_failed |
---|
Still not working correctly:
- Open manual test.
- Create widget after the paragraph.
- Select some text in the widget (place cursor slightly below the widget and start selecting; ensure that widget is not focused).
- Press Backspace.
The selected text in non-editable area is deleted. In the same way it's possible to type a single letter
comment:13 Changed 8 years ago by
Status: | review_failed → review |
---|
Verifying also non-collapsed ranges, updated manual test.
Changes pushed to branch:t/14407.
comment:14 Changed 8 years ago by
Status: | review → review_failed |
---|
The issue described in comment is reproducible also in IE8 and IE9 (strangely I didn't manage to reproduce it in IE10). What's more, unit tests for this ticket are failing in all IEs but IE11.
comment:15 Changed 8 years ago by
Status: | review_failed → review |
---|
Apparently it's not possible to create such a selection in the unit tests in IE's other than 11 - the selection is changed automatically.
Nevertheless all that was required to make this work on other IE's was to change the browser detection check accordingly.
comment:16 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | review → closed |
Now LGTM. Merged with git:a3b2b66.
comment:17 Changed 8 years ago by
Summary: | Widget can be edited in IE. → Non-editable widgets can be edited in IE |
---|
Attached corrected version of the plugin.