Skip to content

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

@NickantX

Description

@NickantX

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions