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

bugfix: avoid bug if domSelection is not displayed in the webpage #152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NomadeLampe
Copy link

Hello, during my work I use Kendo Editor which use this component. It appear that from time to time on Chrome we have the following error TypeError: Cannot read properties of null (reading 'focusNode')\n at EditorView.updateStateInner.

I believe that this small change would prevent this bug.

@NomadeLampe NomadeLampe marked this pull request as ready for review February 17, 2023 11:02
@marijnh
Copy link
Member

marijnh commented Feb 17, 2023

According to the spec Document.getSelection (which is where this value originates) should always return a Selection object unless the document has no browsing context (isn't any window's actual active document). If that is a thing that actually happens in the wild, we'll need to adjust more than just this to account for it. Do you have a way to reproduce this crash or more information about what might be going on when it happens?

@NomadeLampe
Copy link
Author

I have notice this typing from typescript where it return Selection | null but in index.ts the typing looks wrong.

Regarding the way to reproduce it, I will try but I can't copy any code. It happen when use multiple instance of kendo-editor and try to interact with the first one while having a pop-in hiding the editor.

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