diff --git a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift index 3b38acb98..601de08a4 100644 --- a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift +++ b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/View/MessageComposerTextField.swift @@ -88,6 +88,10 @@ private struct UITextViewWrapper: UIViewRepresentable { } func updateUIView(_ textView: UITextView, context: UIViewRepresentableContext) { + // Prevent the textView from inheriting attributes from mention pills + textView.typingAttributes = [.font: font, + .foregroundColor: UIColor(.compound.textPrimary)] + if textView.attributedText != text { textView.attributedText = text @@ -95,10 +99,6 @@ private struct UITextViewWrapper: UIViewRepresentable { textView.font = font textView.textColor = .compound.textPrimary - // Prevent the textView from randomly using the tint color - textView.typingAttributes = [.font: font, - .foregroundColor: UIColor(.compound.textPrimary)] - if text.string.isEmpty { // text cleared, probably because the written text is sent // reload keyboard type