Open pkasson opened 1 month ago
Hi @pkasson
That's unfortunately a side-effect of striving for better performance, since the text editor would otherwise be redrawn whenever you type.
I've been thinking about adding an internal binding that always writes out to the external one, but also listen for those changes and update whenever the external one changes.
For now, you can use setter functions in the rich text context, which affect the editor.
Thanks - that worked. I agree, there is a balancing act on updating content that has rich content and performance
Next Q - how can I set the BG color - it appears maybe using the Theme, but I can't see how to set it to white.
You can set a color with the rich text action approach.
How do you do that ?
You can trigger a RichTextAction
.
The documentation is a bit fuzzy about this, but you can see some examples in the docs: https://danielsaidi.github.io/RichTextKit/documentation/richtextkit/context-article
Yes, quite fuzzy - didn't find anything around this ... thanks for trying - will find another RTF editor.
When the text (@State) is updated, the component does not show it:
@State var text = NSAttributedString(string: "Type text here...")
RichTextEditor(text: $text, context: context) .focusedValue(.richTextContext, context) .focused($isFocused)
The initial text works, but when text is updated, it does not get rendered.