-
-
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
The isWindow helper fails when running the editor in electron #879
Comments
cc @oleq |
@oleq It's weird, can you try it in another driver and path? BTW, I tried again also in my users path, didn't get your problem, here is how I do it: |
I managed to run the code and I found the root of the problem. The problem is in the
but in electron, it is This false negative changes the flow of the application in |
Would it make sense to call it |
BTW, there's one more thing. When working on https://github.com/ckeditor/ckeditor5-utils/blob/master/src/translation-service.js I realised that we need a safe way of accessing the global object. Also, it's a question whether the global object is part of the DOM or not, because the |
The error message is always thrown when the user enters.the sitution really annoying |
It's more of a question to you, guys. We don't know Electron – we'd have to research how things work inside it. If you can find the right way to check if something is the equivalent of the browser's |
I've checked and the After changing
(ofc it would be better to rename it to everything works fine for the https://github.com/ckeditor/ckeditor5-build-classic. |
Cool. Could you make a PR? I'm not sure about renaming it, though. And I think we may need to extend this check with one more thing. In Node.js there's So, first of all, it's fine that this function is inside Secondly, I think it's ok that it's called Thirdly, we may (but don't have to so far) add an additional check that there's an |
I made a PR.
That makes sense to me as we need
I'd wait with it if it's not needed for now. |
Fix: The `isWindow` helper should work in the Electron environment. Closes ckeditor/ckeditor5#879.
Is this a bug report or feature request? (choose one)
🐞 Bug report
💻 Version of CKEditor
"@ckeditor/ckeditor5-build-classic": "^1.0.0-alpha.2"
📋 Steps to reproduce
✅ Expected result
There should be no error report in the developer tool's console window.
❎ Actual result
Every time when enter is hit, an error "cannot read property 'defaultView' of undefined" is reported in the console:
📃 Other details that might be useful
When run the app in browser, no such errors are seen. So it only happens in electron.
I have uploaded the source to https://github.com/li-rongcheng/electron-angular5-ckeditor5 .
To reproduce the issue, do:
then create an ckeditor5 instance and hit 'enter' in the editing area.
I think this might be a ckeditor5's bug because when I use ckeditor4 or other online editors like quill, tinymce or trix, everything were correct, i.e. it only happens in ckeditor5.
The text was updated successfully, but these errors were encountered: