Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
124 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
<textarea name="editor1" id="editor1" cols="30" rows="10"> | ||
<p>Put caret here first.</p> | ||
</textarea> | ||
|
||
<script> | ||
|
||
CKEDITOR.plugins.add( 'noneditablewidget', { | ||
requires: 'widget', | ||
init: function ( editor ) { | ||
editor.widgets.add( 'noneditablewidget', { | ||
button: 'Non-editable widget', | ||
order: 1, | ||
template: '<div class="noneditable">' + | ||
'<div>This part shouldn\'t be editable.</div>' + | ||
'</div>', | ||
allowedContent: 'div(noneditable)', | ||
requiredContent: 'div', | ||
upcast: function( element ) { | ||
return element.name == 'div' && element.hasClass( 'noneditable' ); | ||
} | ||
} ); | ||
} | ||
} ); | ||
|
||
if ( !CKEDITOR.env.ie ) { | ||
bender.ignore(); | ||
} | ||
|
||
CKEDITOR.replace( 'editor1', { | ||
extraPlugins: 'noneditablewidget', | ||
extraAllowedContent: 'div' | ||
} ); | ||
|
||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@bender-tags: tc, 4.7.0, 14407, selection, widget | ||
@bender-ui: collapsed | ||
@bender-ckeditor-plugins: wysiwygarea, toolbar, sourcearea, elementspath | ||
|
||
## Test scenario | ||
|
||
1. There's an empty button at the start of the second row in the toolbar - use it to add a non-editable widget | ||
above the paragraph already present there. | ||
2. Put the caret at the start of the paragraph and press the `up arrow` key. | ||
|
||
** Alternatively: ** | ||
1. Create the non-editable widget. | ||
2. Make the editor lose focus. | ||
3. Place the cursor over the widget so that its icon is `text` and its upper-left corner is exactly at the dot in "editable." | ||
4. Click to try to place the caret inside the editable or drag the mouse to create a range. | ||
|
||
## Expected | ||
|
||
The selection is inside the non-editable area, but once you press any key the whole widget gets selected. | ||
|
||
## Unexpected | ||
|
||
The widget is not selected when you press a key. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters