Svelte 5 and Quill editor with value changed both from inside and outside #14722
Replies: 1 comment 1 reply
-
Although not specifically for Svelte, I’ve encountered a similar case when integrating the Lexical editor. In our case, we solved it by syncing the value only when the editor did not have focus, as we did not want to update the value if the user was actively editing anyway. Another way to solve this could be to save the value from Something along these lines (though it hasn’t been tested due to the loading issue): Playground Perhaps there are better ways, so if anyone knows, please share. 🙂 |
Beta Was this translation helpful? Give feedback.
-
I have this code in the Editor.svelte Svelte 5 component:
It works if I use it like this:
But If I change the
someString
from outside theEditor
doesn't update that text.I tried with an effect, like this:
but as you can imagine this is called each time values changes, from the inside too.
REPL here: https://svelte.dev/playground/81409104a421489d89230aa5814c7c01?version=5.14.0 (but there is an issue loading Quill).
Beta Was this translation helpful? Give feedback.
All reactions