Closed Mcrich23 closed 8 months ago
Hi @Mcrich23
Yes, this is a known limitation when using a SwiftUI ViewRepresentable
, which the RichTextEditor
is.
The RichTextEditor
docs mention this:
Since the view wraps a native UIKit
or AppKit
text view, you can't apply .toolbar
modifiers to it, like you can do with other SwiftUI views. This means that this doesn't work:
RichTextEditor(text: $text, context: context)
.toolbar {
ToolbarItemGroup(placement: .keyboard) {
....
}
}
This will not show anything. To work around this limitation, use a RichTextKeyboardToolbar
instead.
@Mcrich23 You can have a look at the demo app for an example on how to use that toolbar.
When using the
.toolbar
modifier in regards to the keyboard for the RichTextEditor, the keyboard toolbar does not appear.