Skip to content
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

Getting "Cannot read properties of null (reading 'nodeType')" when trying to do cntl+A, cntl+c and cntl+v #1488

Open
Rsi-madhuri opened this issue Sep 19, 2024 · 1 comment

Comments

@Rsi-madhuri
Copy link

Rsi-madhuri commented Sep 19, 2024

Bug Description

When trying to do cntl+A, cntl+c and cntl+v in proseMirror editor. It is showing error- Cannot read properties of null (reading 'nodeType').

This is happening when I have header content which is non-editable and main content which is editable. When I try to do cntl+A, cntl+c and cntl+v. It is selecting only main content which is expected but throwing above error.

The issue is coming from prosemirror-model/dist/index.js file where inside renderSpec function where in line no 3393
if (structure.nodeType != null)
return { dom: structure };
here structure is coming as null.

Browser Used

Chrome

Expected Behavior

When we do cntl+A, cntl+c and cntl+v, all selected text should be copied and pasted in editor instead of throwing error.

@marijnh
Copy link
Member

marijnh commented Sep 19, 2024

here structure is coming as null.

That might be coming from your code. Have you tried reducing this to the minimal code needed to trigger it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants