Skip to content

Commit 623ade3

Browse files
committed
Merge branch 't/13284b'
2 parents d232212 + 66a049e commit 623ade3

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Fixed Issues:
1919
* [#13680](http://dev.ckeditor.com/ticket/13680): Fixed: The parser should allow `<h1-6>` to be a child of the `<summary>` element.
2020
* [#11724](http://dev.ckeditor.com/ticket/11724): [Touch devices] Fixed: Drop-downs often hide right after opening them.
2121
* [#13690](http://dev.ckeditor.com/ticket/13690): Fixed: Copying content from IE to Chrome adding extra paragraph.
22+
* [#13284](http://dev.ckeditor.com/ticket/13284): Fixed: Cannot drag and drop a widget if a text caret is placed just after widget instance.
2223

2324
Other Changes:
2425

plugins/widget/plugin.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,6 +2496,12 @@
24962496
// Block widgets are handled by Lineutils.
24972497
if ( widget.inline && target.type == CKEDITOR.NODE_ELEMENT && target.hasAttribute( 'data-cke-widget-drag-handler' ) ) {
24982498
mouseDownOnDragHandler = 1;
2499+
2500+
// When drag handler is pressed we have to clear current selection if it wasn't already on this widget.
2501+
// Otherwise, the selection may be in a fillingChar, which prevents dragging a widget. (#13284, see comment 8 and 9.)
2502+
if ( widgetsRepo.focused != widget )
2503+
editor.getSelection().removeAllRanges();
2504+
24992505
return;
25002506
}
25012507

tests/tickets/13284/1.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<textarea id="editor1" cols="10" rows="10" style="width:100%; height:500px;">
2+
<p>Lorem ipsum dolor.</p>
3+
<p>[[ABCDEFG]]</p>
4+
<p>Lorem ipsum dolor.</p>
5+
</textarea>
6+
<script>
7+
CKEDITOR.replace( 'editor1', {
8+
extraPlugins: 'placeholder',
9+
height: 320
10+
} );
11+
</script>

tests/tickets/13284/1.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@bender-ui: collapsed
2+
@bender-tags: tc, 4.5.4, 13284
3+
@bender-ckeditor-plugins: wysiwygarea, placeholder, undo, toolbar
4+
5+
1. Focus placeholder widget.
6+
2. Press <kbd>Right Arrow</kbd> key.
7+
3. Caret should be placed next to placeholder.
8+
4. Without focusing the widget, try to drag and drop it.
9+
10+
**Expected result**: Widget has been correctly moved.
11+
12+
**Unexpected results**: Widget didn't move, errors in console.
13+
14+
------------------
15+
16+
1. Focus placeholder widget.
17+
2. Try to drag and drop it.
18+
19+
**Unexpected results**: Widget didn't move, widget border color flickered.

0 commit comments

Comments
 (0)