mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-16 06:28:27 +02:00
Set a keyCommandHandler, otherwise the placeholder will never be removed.
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/Cocoanetics/DTCoreText",
|
||||
"state" : {
|
||||
"revision" : "9d2d4d2296e5d2d852a7d3c592b817d913a5d020",
|
||||
"version" : "1.6.27"
|
||||
"revision" : "b664664825da565b4c2b7a17dbe2369f68ae43d9",
|
||||
"version" : "1.6.26"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -50,8 +50,8 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/matrix-org/matrix-wysiwyg-composer-swift",
|
||||
"state" : {
|
||||
"revision" : "1100b217c04d096dfe072afb4484660ff794d805",
|
||||
"version" : "2.2.2"
|
||||
"revision" : "379ab4d0ff194eba197606c56345e5718b2e3810",
|
||||
"version" : "2.15.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -143,7 +143,7 @@ struct Composer: View {
|
||||
placeholder: viewModel.viewState.placeholder ?? "",
|
||||
viewModel: wysiwygViewModel,
|
||||
itemProviderHelper: nil,
|
||||
keyCommandHandler: nil,
|
||||
keyCommandHandler: handleKeyCommand,
|
||||
pasteHandler: nil
|
||||
)
|
||||
.onAppear {
|
||||
@@ -219,6 +219,17 @@ struct Composer: View {
|
||||
}
|
||||
}
|
||||
|
||||
func handleKeyCommand(_ keyCommand: WysiwygKeyCommand) -> Bool {
|
||||
switch keyCommand {
|
||||
case .enter:
|
||||
sendMessageAction(wysiwygViewModel.content)
|
||||
wysiwygViewModel.clearContent()
|
||||
return true
|
||||
case .shiftEnter:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Public
|
||||
|
||||
init(
|
||||
|
||||
Reference in New Issue
Block a user