Skip to content

Commit

Permalink
Merge pull request #4800 from ckeditor/t/4782
Browse files Browse the repository at this point in the history
Prevent autocomplete invocation on not existing editable [FF]
  • Loading branch information
f1ames authored Jul 30, 2021
2 parents 4fd92fc + 29f3676 commit 7c43995
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Fixed Issues:
* [#3638](https://github.com/ckeditor/ckeditor4/issues/3638): Fixed: Opening the same dialog twice causes it to become hidden under the dialog's page cover.
* [#4247](https://github.com/ckeditor/ckeditor4/issues/4247): Fixed: [Color Button](https://ckeditor.com/cke4/addon/colorbutton)'s incorrect rendering on the first opening.
* [#4555](https://github.com/ckeditor/ckeditor4/issues/4555): Fixed: [Font](https://ckeditor.com/cke4/addon/font) styles with attributes are not applied correctly when used multiple times over the same selection.
* [#4782](https://github.com/ckeditor/ckeditor4/issues/4782): [Firefox] Fixed: `TypeError` is thrown when switching to Source View and back while [Autocomplete](https://ckeditor.com/cke4/addon/autocomplete) plugin is enabled.

## CKEditor 4.16.1

Expand Down
2 changes: 1 addition & 1 deletion plugins/autocomplete/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@
var editable = this.editor.editable(),
isActive = evt.data;

if ( !editable.isInline() ) {
if ( !editable || !editable.isInline() ) {
return;
}

Expand Down
9 changes: 9 additions & 0 deletions tests/plugins/emoji/manual/editablenullerror.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<textarea id="editor"></textarea>

<script>
if ( bender.tools.env.mobile ) {
bender.ignore();
}

CKEDITOR.replace( 'editor' );
</script>
9 changes: 9 additions & 0 deletions tests/plugins/emoji/manual/editablenullerror.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@bender-tags: 4.16.2, bug, emoji, 4782
@bender-ckeditor-plugins: wysiwygarea, sourcearea, toolbar, emoji
@bender-ui: collapsed

1. Open browser's dev console.
1. Switch to `source` mode.
1. Switch to `wysiwyg` mode.

**Expected** No errors in the console.

0 comments on commit 7c43995

Please sign in to comment.