Open luan opened 2 years ago
@luan on firefox the extra text nodes that svelte adds is causing this issue, there is some discussion around whitespace handling in svelte here https://github.com/sveltejs/svelte/issues/3080, not sure how I want to handle this issue yet, because I cant just remove the nodes cuz it breaks sveltes rendering
@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: https://github.com/sveltejs/svelte/issues/189
@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 https://github.com/sveltejs/svelte/issues/189 but it didn't help unfortunately.
@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
@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?
@hardyjosh its only when its content-editable from what i can tell, now the css pre-wrap i have not tried anything with yet
@nathanfaucett I tried some other css but then you lose the intentional whitespace too. Although maybe there's some way to make it work.
This gif shows the issue:
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.