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] Cannot leave node with keyboard on firefox #5

Open
luan opened this issue Sep 11, 2022 · 7 comments
Open

[firefox] Cannot leave node with keyboard on firefox #5

luan opened this issue Sep 11, 2022 · 7 comments
Assignees

Comments

@luan
Copy link

luan commented Sep 11, 2022

This gif shows the issue:

Kapture 2022-09-11 at 13 05 55

It seems the caret is stuck in a non-editable part of the document, can't get out of it unless you click somewhere in the text.
This reproduces on the any of the other editors (rich editor, etc) if you click at the end of a line.

Importanly, this does not happen on the React version of slate (slate official examples, for instance).

No errors are shown in the console, just a lack of ability to edit. Works fine on Chrome/Safari.

@nathanfaucett nathanfaucett self-assigned this Sep 14, 2022
@nathanfaucett
Copy link
Owner

@luan on firefox the extra text nodes that svelte adds is causing this issue, there is some discussion around whitespace handling in svelte here sveltejs/svelte#3080, not sure how I want to handle this issue yet, because I cant just remove the nodes cuz it breaks sveltes rendering

@DataDaoDe
Copy link
Collaborator

@nathanfaucett It looks like they are resolving this now with a preprocessor, not really sure if they actually have a solution that works for our use case here though, see: sveltejs/svelte#189

@hardyjosh
Copy link

@nathanfaucett any more thoughts on this issue? this package is so great and works perfectly on chrome etc, the firefox issue is such a shame.

@DataDaoDe i tried adding the preprocessor replace in sveltejs/svelte#189 but it didn't help unfortunately.

@nathanfaucett
Copy link
Owner

@hardyjosh I am not sure of a way to fix this in this library, I have tried writing something that removes the text nodes in the content editable elements, but it breaks the compiled svelte code, so unless this can be fixed in the svelte compiler, I'm not sure I know of a way to fix this issue for FireFox

@hardyjosh
Copy link

@nathanfaucett no worries, I tried a few quick things also but you're right.

Why are the extra text nodes such an issue in this case and not always? Is it because it's content-editable and the css is pre-wrap?

@nathanfaucett
Copy link
Owner

@hardyjosh its only when its content-editable from what i can tell, now the css pre-wrap i have not tried anything with yet

@hardyjosh
Copy link

@nathanfaucett I tried some other css but then you lose the intentional whitespace too. Although maybe there's some way to make it work.

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

4 participants