Merge pull request #7027 from vector-im/mauroromito/6946_custom_emojis

Labs: Rich text-editor fix for "does not support inserting custom iOS emojis"
This commit is contained in:
Velin92
2022-11-02 17:31:19 +01:00
committed by GitHub
8 changed files with 33 additions and 10 deletions
@@ -25,7 +25,6 @@ struct Composer: View {
@Environment(\.theme) private var theme: ThemeSwiftUI
@State private var focused = false
@State private var isActionButtonShowing = false
private let horizontalPadding: CGFloat = 12
@@ -60,7 +59,7 @@ struct Composer: View {
}
private var borderColor: Color {
focused ? theme.colors.quarterlyContent : theme.colors.quinaryContent
viewModel.focused ? theme.colors.quarterlyContent : theme.colors.quinaryContent
}
private var formatItems: [FormatItem] {
@@ -112,7 +111,7 @@ struct Composer: View {
}
HStack(alignment: .top, spacing: 0) {
WysiwygComposerView(
focused: $focused,
focused: $viewModel.focused,
viewModel: wysiwygViewModel
)
.tintColor(theme.colors.accent)
@@ -143,8 +142,8 @@ struct Composer: View {
.padding(.horizontal, horizontalPadding)
.padding(.top, 8)
.onTapGesture {
if !focused {
focused = true
if viewModel.focused {
viewModel.focused = true
}
}
HStack(spacing: 0) {