You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I show and close the RichTextEditor view several times, an error appears: the background becomes white or black (depending on the device’s theme).
There’s also always an error indicating that text kit 1 is being used, and in that case, everything works fine (no background errors), but as soon as the error disappears, the background turns white or black.
The error under which everything works, funny as it may sound:
.richTextEditorConfig(
RichTextEditorConfig(isScrollingEnabled: true)
)
.richTextEditorStyle(RichTextEditorStyle(fontColor: .white))
// Use this to just view the text:
// RichTextViewer(document.text)
When I show and close the RichTextEditor view several times, an error appears: the background becomes white or black (depending on the device’s theme).
There’s also always an error indicating that text kit 1 is being used, and in that case, everything works fine (no background errors), but as soon as the error disappears, the background turns white or black.
The error under which everything works, funny as it may sound:
Display:
Code:
VStack {
FcomFctm(stuck: stuck)
TextEditorKit(text: stuck.textRussian, height: stuck.textRusHeight, rusOrNo: true)
}
import SwiftUI
import RichTextKit
struct TextEditorKit: View {
#if os(macOS)
RichTextFormat.Toolbar(context: context)
#endif
RichTextEditor(
text: $text,
context: context
)
{
if $0.richText.string.isEmpty {
if rusOrNo {
$0.pasteText("Текст", at: 0)
} else {
$0.pasteText("Text", at: 0)
}
$0.textContentInset = CGSize(width: 10, height: 10)
$0.setRichTextColor(.foreground, to: .white, at: NSRange(location: 0, length: 5))
}
}
#if os(iOS)
// RichTextKeyboardToolbar(
// context: context,
// leadingButtons: { $0 },
// trailingButtons: { $0 },
// formatSheet: { $0 }
// )
#endif
}
.frame(height: 35 + height)
.toolbar {
ToolbarItem(placement: .automatic) {
Toggle(isOn: $isInspectorPresented) {
Image.richTextFormatBrush
.resizable()
.aspectRatio(1, contentMode: .fit)
}
}
}
}
The text was updated successfully, but these errors were encountered: