Fix dictation when using the Rich Text Editor. (#7752)

This commit is contained in:
Doug
2024-02-14 15:19:33 +00:00
committed by GitHub
parent 01d85ec4c6
commit 9c84b476db
5 changed files with 14 additions and 15 deletions
@@ -137,7 +137,7 @@ struct Composer: View {
placeholder: viewModel.viewState.placeholder ?? "",
viewModel: wysiwygViewModel,
itemProviderHelper: nil,
keyCommandHandler: handleKeyCommand,
keyCommands: keyCommands,
pasteHandler: nil
)
.clipped()
@@ -228,15 +228,13 @@ struct Composer: View {
}
}
func handleKeyCommand(_ keyCommand: WysiwygKeyCommand) -> Bool {
switch keyCommand {
case .enter:
sendMessageAction(wysiwygViewModel.content)
wysiwygViewModel.clearContent()
return true
case .shiftEnter:
return false
}
var keyCommands: [WysiwygKeyCommand] {
[
.enter {
sendMessageAction(wysiwygViewModel.content)
wysiwygViewModel.clearContent()
}
]
}
/// Computes the total height of the composer (excluding the RTE formatting bar).