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

[firefox] error when selecting first character and trying to type #7

Open
NickantX opened this issue Feb 14, 2023 · 0 comments
Open

Comments

@NickantX
Copy link

This seems to only happen in Firefox and may be caused by #5 with the additional whitespace being inserted. If the first character in the editor is highlighted, and you try to type, you get an error:

Uncaught Error: Cannot resolve a Slate point from DOM point: [object Text],0

This does not happen in Chromium. See the following GIF: https://gyazo.com/1e59a43c34826eec4ae56085839ae499

Yes, I have addons installed, but I also tested this in a clean-install of Firefox Developer Edition and can confirm the same still happens.

I modified toSlateRange in utils.js to simply log what is being passed for domRange. It seems that the starting element is an invisible empty text node whereas it is correctly the first text node in Chromium. It seems the next sibling node is the correct element so perhaps a fix for this specific issue could be an IS_FIREFOX check selecting the sibling node as the start to the range.

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

1 participant