Opened 5 years ago

Closed 4 years ago

#10926 closed Bug (fixed)

[Android][Chrome]CKEditor 4.2 'change' event not fired on Android (Chrome or Native)

Reported by: Chris Ingham Owned by:
Priority: Normal Milestone: CKEditor 4.4.4
Component: Core : Editable Version: 4.2.1
Keywords: Android Cc: chris.ingham@…

Description (last modified by Piotrek Koszuliński)

Updated our project to use the version 4.2 'change' event (ticket 9794), and all seemed fine until we discovered the event is not fired on Android Chrome or the native Android Webkit browser.

Can reproduce on either the demo#inline or nightly inlineall.html versions via the developer tools console:

CKEDITOR.instances.editor1.on('focus', function(){console.log("Focused!");}); CKEDITOR.instances.editor1.on('change', function(){console.log("Changed!");});

This works great on Firefox, Chrome on desktop (Windows 8), but I only see the "Focused!" output on Android (connected to a Nexus 7 using ADB, also seen on a Galaxy Tab 10.1 and a 1st-gen Asus Transformer)

Part of: #11739.

Change History (15)

comment:1 Changed 5 years ago by Jakub Ś

Keywords: Android added

comment:2 Changed 5 years ago by Chris Ingham

Still seeing on 4.3.1

Slight changes to duplicating on the demo#inline page:

CKEDITOR.instances.editor2.on('focus', function(){console.log("Focused!");}); CKEDITOR.instances.editor2.on('blur', function(){console.log("Blurred!");}); CKEDITOR.instances.editor2.on('change', function(){console.log("Changed!");});

Connect Android device to a desktop using ADB - you'll see "Focused!" and "Blurred!" but no "Changed!" events as you add text (Although you DO see "Changed!" when you press Backspace!)

Although it looks like you still don't officially support it, CKEditor mostly works on Android. This, however, is fairly serious. Is there any chance of getting the priority bumped???

comment:3 Changed 5 years ago by Björn Weinbrenner

Change is not fired properly because the keypress event is used in the code. Keypress is not supported by Android and some other mobile browsers (e.g. Windows).
I created a ticket to replace keypress generally with other events: http://dev.ckeditor.com/ticket/11575

For my application which uses CKEditor I use an alternative approach. I created a plugin which checks periodically if the content has changed by creating a checksum. So I got rid of the event problems.

comment:4 Changed 5 years ago by Jakub Ś

@bjoerne in such cases please don't create duplicate tickets. It is enough to add new comment. I have moved your comment here:

According the official W3C specification the event 'keypress' is deprecated (http://www.w3.org/TR/DOM-Level-3-Events/#event-type-keypress). Some modern mobile browsers (Android, Windows) don't support this event. Alternative events are keydown, keyup, input or textInput (supported by some browsers but not specified), beforeinput (specified but not supported by browsers).
CKEditor uses keypress at some places and causes problems on mobile devices. One place is the UndoManager (plugins/undo/plugin.js) so that the 'change' event isn't fired properly on mobile devices.

editor.editable().on( 'keypress', function( event ) {
	undoManager.type( event.data.getKey(), 1 );
} );
Last edited 4 years ago by Jakub Ś (previous) (diff)

comment:5 Changed 5 years ago by Piotrek Koszuliński

cc

comment:6 Changed 4 years ago by Piotr Jasiun

Confirmed on Android 4.4.2 with Chrome 33 and CKEditor 4.3.4.

Last edited 4 years ago by Piotr Jasiun (previous) (diff)

comment:7 Changed 4 years ago by Piotr Jasiun

Status: newconfirmed

comment:8 Changed 4 years ago by Jakub Ś

Summary: CKEditor 4.2 'change' event not fired on Android (Chrome or Native)[Android][Chrome]CKEditor 4.2 'change' event not fired on Android (Chrome or Native)

comment:9 Changed 4 years ago by Piotrek Koszuliński

Description: modified (diff)

comment:10 Changed 4 years ago by Piotrek Koszuliński

Description: modified (diff)

comment:11 Changed 4 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.2

comment:12 Changed 4 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.2CKEditor 4.4.3

As part of #11739 this ticket needs to be postponed too (http://dev.ckeditor.com/ticket/11739#comment:17).

comment:13 Changed 4 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.3CKEditor 4.4.4

The 4.4.3 milestone was shortened, so the remaining tickets must be postponed.

comment:14 Changed 4 years ago by Piotr Jasiun

Change event works fine with 4.4.4 master branch. I have tested it on Android 4.4.2 with Chrome 35. Tested both classic and inline editors.

Last edited 4 years ago by Piotr Jasiun (previous) (diff)

comment:15 Changed 4 years ago by Piotrek Koszuliński

Resolution: fixed
Status: confirmedclosed

Thanks. So this issue was fixed in #11739.

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy