-
Notifications
You must be signed in to change notification settings - Fork 675
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
Cannot read properties of null (reading 'parent') error occurs when trying to type text into CKEditor #7642
Comments
For team:
|
I have the same issue |
Here you are a workaround:
|
Hi @aorioir Thank you for sharing your workaround. |
Trying the workaround (using t.eval) from this thread, but not resolved the issue. running into The code snippet
|
Can you please share the complete workaround example based on the test code @Artem-Babich or @aorioir? If we look at the example and plug in the workaround, the below is what we have. I attached TS errors based on the code.
![]() ![]() |
Perhaps this could also be researched further and potentially fixed so there is no need for workarounds? CKEditor is quite popular so there are probably more people running into this issue. |
I'm facing the same issue, it's blocking some of our deployment pipelines, I would really appreciate it if it gets prioritized. |
maybe you can try to pass your text string throw a variable and use the second parameter of t.eval function
|
Thanks for the response @aorioir We managed to get it to work by doing the following in case someone else is looking for more solutions
|
Hi folks, There are some browser restrictions related to typing text into the content-editable elements. For example, inputEvent.getTargetRanges will always return an empty list. To avoid this behavior, use the selectEditableContent method. Example (this code will change the import { Selector } from 'testcafe';
fixture `test-fixt`
.page('https://ckeditor.com/ckeditor-5/demo/feature-rich/')
test('test', async t => {
const editableRoot = Selector('.ck.ck-content.ck-editor__editable');
const h2Editable = editableRoot.find('h2');
await t
.click(editableRoot)
.selectEditableContent(h2Editable, h2Editable)
.pressKey('n e w t i t l e');
}); |
Thanks @miherlosev, I test CKEditor stuff and in Chrome the workaround is working. But Firefox is not typing as it has problems with selectEditableContent. The range is always null and leads to an error. Did you face the same issue? |
Hello, I researched this issue. Unfortunately, there is a limitation for this workaround. It works in Native Automation mode in Chrome and Edge. However, it does not work in Firefox and with Native Automation disabled. I recommend that you skip this test in Firefox and run it only in Chrome or Edge with Native Automation. |
What is your Scenario?
Open the following page and type any text with typeText command: https://ckeditor.com/ckeditor-5/demo/feature-rich/
What is the Current behavior?
Nothing is entered and an error occurs
What is the Expected behavior?
The text should be typed without errors
What is your public website URL? (or attach your complete example)
https://ckeditor.com/ckeditor-5/demo/feature-rich/
What is your TestCafe test code?
Your complete configuration file
No response
Your complete test report
Screenshots
No response
Steps to Reproduce
TestCafe version
2.5.0
Node.js version
18.14.2
Command-line arguments
testcafe chrome test.js
Browser name(s) and version(s)
Chrome 112.0.5615.121 (Official Build) (64-bit)
Platform(s) and version(s)
Ubuntu 22.04
Other
No response
The text was updated successfully, but these errors were encountered: