Skip to content

Commit 1dc609b

Browse files
authored
Fix dictation when using the Rich Text Editor. (#7752)
1 parent 2a6677c commit 1dc609b

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

Riot.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
"kind" : "remoteSourceControl",
5151
"location" : "https://github.com/matrix-org/matrix-wysiwyg-composer-swift",
5252
"state" : {
53-
"revision" : "0aa1308c43451fd077e332f72d6a32135f258834",
54-
"version" : "2.19.0"
53+
"revision" : "f788fe2482c0b89019f679a1f43dccf9c25a0782",
54+
"version" : "2.29.0"
5555
}
5656
},
5757
{

Riot/Generated/Strings.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9599,15 +9599,15 @@ public class VectorL10n: NSObject {
95999599
public static var wysiwygComposerFormatActionQuote: String {
96009600
return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_quote")
96019601
}
9602-
/// Apply underline format
9602+
/// Apply strikethrough format
96039603
public static var wysiwygComposerFormatActionStrikethrough: String {
96049604
return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_strikethrough")
96059605
}
96069606
/// Decrease indentation
96079607
public static var wysiwygComposerFormatActionUnIndent: String {
96089608
return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_un_indent")
96099609
}
9610-
/// Apply strikethrough format
9610+
/// Apply underline format
96119611
public static var wysiwygComposerFormatActionUnderline: String {
96129612
return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_underline")
96139613
}

RiotSwiftUI/Modules/Room/Composer/View/Composer.swift

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ struct Composer: View {
137137
placeholder: viewModel.viewState.placeholder ?? "",
138138
viewModel: wysiwygViewModel,
139139
itemProviderHelper: nil,
140-
keyCommandHandler: handleKeyCommand,
140+
keyCommands: keyCommands,
141141
pasteHandler: nil
142142
)
143143
.clipped()
@@ -228,15 +228,13 @@ struct Composer: View {
228228
}
229229
}
230230

231-
func handleKeyCommand(_ keyCommand: WysiwygKeyCommand) -> Bool {
232-
switch keyCommand {
233-
case .enter:
234-
sendMessageAction(wysiwygViewModel.content)
235-
wysiwygViewModel.clearContent()
236-
return true
237-
case .shiftEnter:
238-
return false
239-
}
231+
var keyCommands: [WysiwygKeyCommand] {
232+
[
233+
.enter {
234+
sendMessageAction(wysiwygViewModel.content)
235+
wysiwygViewModel.clearContent()
236+
}
237+
]
240238
}
241239

242240
/// Computes the total height of the composer (excluding the RTE formatting bar).

changelog.d/7752.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix dictation when using the Rich Text Editor

project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ packages:
5959
branch: 0.0.1
6060
WysiwygComposer:
6161
url: https://github.com/matrix-org/matrix-wysiwyg-composer-swift
62-
version: 2.19.0
62+
version: 2.29.0
6363
DeviceKit:
6464
url: https://github.com/devicekit/DeviceKit
6565
majorVersion: 4.7.0

0 commit comments

Comments
 (0)