forked from ckeditor/ckeditor4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ckeditor#2188 from ckeditor/t/2187
Autocomplete dropdown mouseover no longer throws an error
- Loading branch information
Showing
4 changed files
with
87 additions
and
5 deletions.
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,37 @@ | ||
<div id="editor1" ></div> | ||
|
||
<script> | ||
|
||
if ( autocompleteUtils.isUnsupportedEnvironment() || CKEDITOR.env.mobile ) { | ||
bender.ignore(); | ||
} | ||
|
||
CKEDITOR.replace( 'editor1', { | ||
width: 600, | ||
on: { | ||
instanceReady: function( evt ) { | ||
|
||
// Default autocomplete instance. | ||
new CKEDITOR.plugins.autocomplete( evt.editor, { | ||
textTestCallback: autocompleteUtils.getTextTestCallback(), | ||
dataCallback: autocompleteUtils.getDataCallback() | ||
} ); | ||
|
||
var DATA = [ | ||
{ id: 1, name: '#john' }, | ||
{ id: 2, name: '#thomas' }, | ||
{ id: 3, name: '#anna' }, | ||
{ id: 4, name: '#cris' }, | ||
{ id: 5, name: '#julia' } | ||
]; | ||
|
||
// Autocomplete instance with custom template. | ||
new CKEDITOR.plugins.autocomplete( evt.editor, { | ||
textTestCallback: autocompleteUtils.getTextTestCallback( { regex: '#\\w*$' } ), | ||
dataCallback: autocompleteUtils.getDataCallback( { data: DATA } ), | ||
itemTemplate: '<li data-id="{id}"><b>{name}</b></li>' | ||
} ); | ||
} | ||
} | ||
} ); | ||
</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 |
---|---|---|
@@ -1,18 +1,24 @@ | ||
@bender-tags: 4.10.0, bug, 2031 | ||
@bender-tags: 4.10.0, bug, 2031, 2187 | ||
@bender-ui: collapsed | ||
@bender-ckeditor-plugins: wysiwygarea, toolbar, basicstyles, autocomplete | ||
@bender-ckeditor-plugins: wysiwygarea, toolbar, basicstyles, autocomplete, textmatch | ||
@bender-include: _helpers/utils.js | ||
|
||
1. Open a console. | ||
1. Focus the editor. | ||
1. Type `@`. | ||
1. Type `@` character to open autocomplete with default template. | ||
1. Move mouse over the last dropdown item. | ||
1. Press enter. | ||
1. Repeat with `#` character to open autocomplete with custom template. | ||
|
||
|
||
## Expected | ||
|
||
Selection changes when moving mouse over dropdown items. The last selected item is inserted on `enter` key. | ||
* No errors inside console. | ||
* Selection changes when moving mouse over dropdown items. | ||
* The last selected item is inserted on `enter` key. | ||
|
||
## Unexpected | ||
|
||
First item is preselected regardless of mouse hover. The first item is inserted on `enter` key. | ||
* Any errors inside console. | ||
* First item is preselected regardless of mouse hover. | ||
* The first item is inserted on `enter` key. |