ckeditor / ckeditor4

The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.
https://ckeditor.com/ckeditor-4
Other
5.79k stars 2.47k forks source link

Korean typing is ignored by Text Watcher #3069

Open kwo2002 opened 5 years ago

kwo2002 commented 5 years ago

When I typing korean in the IE 11, textwatcher check function selectionRange collapsed is false.

So, mention (mention plugin using textwatcher) plugin text search not working.

I was added below code, and then mention(textwatcher) is working.

Steps to reproduce

  1. Open mentions manual test e.g. tests/plugins/mentions/manual/mentions
  2. Change OS language to Korean.
  3. Update mentions data feed with Korean words.
  4. Start typing in Korean to trigger autocompletion.

Expected

Words are autocompleted.

Actual

Nothing happens.

check: function( evt ) {
            if ( this.ignoreNext ) {
                this.ignoreNext = false;
                return;
            }

            // Ignore control keys, so they don't trigger the check.
            if ( evt && evt.name == 'keyup' && ( CKEDITOR.tools.array.indexOf( this.ignoredKeys, evt.data.getKey() ) != -1 ) ) {
                return;
            }

            var sel = this.editor.getSelection();
            if ( !sel ) {
                return;
            }

            var selectionRange = sel.getRanges()[ 0 ];

            // I was add this line.
            selectionRange.collapse();

            if ( !selectionRange ) {
                return;
            }
            this._buffer.input( selectionRange );
        },

Other

CKEditor version: 4.10.0 Browser: IE11

jacekbogdanski commented 5 years ago

It looks like Korean letters are preselected on IE11, so textwatcher always fails on attached code listing.

I updated your issue description to make it a bit more readable.

f1ames commented 5 years ago

@kwo2002 Is the PR you proposed (https://github.com/ckeditor/ckeditor-dev/pull/3070) aimed to fix this issue?

kwo2002 commented 5 years ago

@kwo2002 Is the PR you proposed (#3070) aimed to fix this issue?

Yes