Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 't/13284b'
  • Loading branch information
Reinmar committed Sep 21, 2015
2 parents d232212 + 66a049e commit 623ade3
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -19,6 +19,7 @@ Fixed Issues:
* [#13680](http://dev.ckeditor.com/ticket/13680): Fixed: The parser should allow `<h1-6>` to be a child of the `<summary>` element.
* [#11724](http://dev.ckeditor.com/ticket/11724): [Touch devices] Fixed: Drop-downs often hide right after opening them.
* [#13690](http://dev.ckeditor.com/ticket/13690): Fixed: Copying content from IE to Chrome adding extra paragraph.
* [#13284](http://dev.ckeditor.com/ticket/13284): Fixed: Cannot drag and drop a widget if a text caret is placed just after widget instance.

Other Changes:

Expand Down
6 changes: 6 additions & 0 deletions plugins/widget/plugin.js
Expand Up @@ -2496,6 +2496,12 @@
// Block widgets are handled by Lineutils.
if ( widget.inline && target.type == CKEDITOR.NODE_ELEMENT && target.hasAttribute( 'data-cke-widget-drag-handler' ) ) {
mouseDownOnDragHandler = 1;

// When drag handler is pressed we have to clear current selection if it wasn't already on this widget.
// Otherwise, the selection may be in a fillingChar, which prevents dragging a widget. (#13284, see comment 8 and 9.)
if ( widgetsRepo.focused != widget )
editor.getSelection().removeAllRanges();

return;
}

Expand Down
11 changes: 11 additions & 0 deletions tests/tickets/13284/1.html
@@ -0,0 +1,11 @@
<textarea id="editor1" cols="10" rows="10" style="width:100%; height:500px;">
<p>Lorem ipsum dolor.</p>
<p>[[ABCDEFG]]</p>
<p>Lorem ipsum dolor.</p>
</textarea>
<script>
CKEDITOR.replace( 'editor1', {
extraPlugins: 'placeholder',
height: 320
} );
</script>
19 changes: 19 additions & 0 deletions tests/tickets/13284/1.md
@@ -0,0 +1,19 @@
@bender-ui: collapsed
@bender-tags: tc, 4.5.4, 13284
@bender-ckeditor-plugins: wysiwygarea, placeholder, undo, toolbar

1. Focus placeholder widget.
2. Press <kbd>Right Arrow</kbd> key.
3. Caret should be placed next to placeholder.
4. Without focusing the widget, try to drag and drop it.

**Expected result**: Widget has been correctly moved.

**Unexpected results**: Widget didn't move, errors in console.

------------------

1. Focus placeholder widget.
2. Try to drag and drop it.

**Unexpected results**: Widget didn't move, widget border color flickered.

0 comments on commit 623ade3

Please sign in to comment.