-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Text does not show when updating state #203
Comments
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 The documentation is a bit fuzzy about this, but you can see some examples in the docs: |
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.
The text was updated successfully, but these errors were encountered: