-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android][Cordova]Create an Editor failed on Android WebView #683
Comments
@Mgsy, am I right that you tested CKE5 in WebView? What was the result? |
Yes, I was testing CKE5 in WebView and the editor has initialized and worked properly. I've just checked it again( WebView on Android 7.0) and everything was fine. I think this part:
is important in this issue. Probably error is caused by way how |
The cordova build doesn't modify the ckeditor.js itself. It just included in the index.html. |
Is possible to get/build a non minified version from the ckeditor.js. With that I would be able to debug where that HTMLDocument element came from. |
On iOS webview I also get an error with ckeditor.js |
@stevesum, thanks for details. I've created a simple project with |
Ok. Tell me if I able to help more. This editor is very important us to include in the next version of our application, and I should know if I have to downgrade the ckeditor to version 4 or the version 5 will get a bugfix soon. |
This is due to lack of support for ES6 in iOS's webview ;/. You'd need to transpile CKEditor to ES5. It's covered in this guide: https://docs.ckeditor.com/ckeditor5/latest/builds/guides/integration/advanced-setup.html#Option-Building-to-ES5-target. |
You need to change webpack's configuration and rebuild the editor. You can find more details about how to rebuild the editor here: https://docs.ckeditor.com/ckeditor5/latest/builds/guides/integration/advanced-setup.html. You will need to disable (just remove them) these 3 lines to get a non-minified version: |
With the ES5 build on iOS webView I get same result as on Android. |
The reason as I see is in the Sencha ExtJS 5.2 (or because the cordova), the 'addEventListener' function of the Document node is:
what is not match with your regexp pattern in the isNative function
therefore the listenTo function in the DomEmitterMixin won't replace it with a ProxyEmitter, so the element won't get the 'on' method, when the clickOutsideHandler is called. Have you any idea how could I fix this? |
It's a bug in Sench/Cordova. We use We may stop using |
Then the conclusion is to use CKEditor 4 for now? |
It depends on:
|
So the problem is that a framework overwrites a native function? If so, there's very little we can do about it. The good news is that the problem could be resolved by applying one of the solutions here https://github.com/ckeditor/ckeditor5-utils/issues/201#issuecomment-344218812. |
Yes. I think that something like this. And zone.js was fixed by Angular devs by customizing the I'm not sure whether https://github.com/ckeditor/ckeditor5-utils/issues/201#issuecomment-344218812 is the right solution β we'll need to write some proper heuristic because the problem is that we can't use |
Yes. Probably the cordova what override that native addEventListener function to send messages from the native code to the webview. (And I don't think they too flexible with change request. I opened an issue there almost 1 month ago, and still not a response.) Just an another question: Now I generate a non minified code (disabled the BabiliPlugin in webpack.config) but it still generate the .map file and require to load it. Is any way in the config to switch off the generation of the map file also? |
I disagree. We can use node instanceof node.ownerDocument.defaultView.Node instead. Of course checking if |
@stevesum I hope this PR will help ckeditor/ckeditor5-utils#208. |
This file is only loaded if you have the console open. So it doesn't slow down your app for your users. But if you want to disable source maps anyway, then it would be this line: https://github.com/ckeditor/ckeditor5-build-classic/blob/fca5ff7599615f92813516c51f0ddc85c70f0744/webpack.config.js#L18. |
@oleq your solution works perfectly on cordova @Reinmar now the editor is appeared, but I can't write anything into on iOS devices with virtual keyboard.
If I tap into the editor part, then I get the virtual keyboard, but my typing doesn't write into the area and not stored either in the value. |
Also hitting the same problem as @stevesum in Cordova for Android, I will try the fix from #683 (comment) once I have more time. |
@filippov The fix from #683 comment will solve the editor creation problem,
but I still not able to use the CKEditor 5 in cordova apps, because it
can't handle well the virtual keyboard there. So the editor will rendered,
and everything seems to work until you try to type something in to the
editor.
The virtual keyboard will appear automatically as you tap into the editor
area, but your typing won't be added there (nor to the value of the editor)
So temporarily I downgraded to the CKEditor 4.
2017-11-29 2:42 GMT+01:00 Vlad Filippov <[email protected]>:
β¦ and just to confirm custom addEventListener is probably to blame:
Cordova (Left) | simple webpage in Chrome (Right)
[image: image]
<https://user-images.githubusercontent.com/128755/33353610-9be49bea-d47c-11e7-919c-119122a30309.png>
β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#683 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACQrUIdSRFVLHNGq139GMdkrT3O17RoGks5s7LaWgaJpZM4Qlxpw>
.
|
@Reinmar would you able to check the problem with the virtual keyboard? Or please give me any suggestion where to try debug why the virtual keyboard types not cached by the CKEditor 5 in cordova webView? |
Could you create a separate ticket for it? To not merge too many issues into this one. |
Ok. #701 |
Do the issues mentioned in this ticket still occur? |
Closing due to lack of activity. |
π Is this a bug report or feature request? (choose one)
π» Version of CKEditor
CKEditor 5 classic editor build 1.0.0-alpha.2
π Steps to reproduce
β Expected result
The editor should replace the textarea
β Actual result
Exeption is thrown:
π Other details that might be useful
The application runs in a native WebView (built by cordova)
navigator.userAgent
"Mozilla/5.0 (Linux; Android 7.0; BTV-W09 Build/HUAWEIBEETHOVEN-W09; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/62.0.3202.84 Mobile Safari/537.36"
The device is an Android 7.1.1
The text was updated successfully, but these errors were encountered: