Skip to content

Commit

Permalink
Fix dictation when using the Rich Text Editor. (#7752)
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave committed Feb 14, 2024
1 parent 2a6677c commit 1dc609b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Riot.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/matrix-org/matrix-wysiwyg-composer-swift",
"state" : {
"revision" : "0aa1308c43451fd077e332f72d6a32135f258834",
"version" : "2.19.0"
"revision" : "f788fe2482c0b89019f679a1f43dccf9c25a0782",
"version" : "2.29.0"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Riot/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9599,15 +9599,15 @@ public class VectorL10n: NSObject {
public static var wysiwygComposerFormatActionQuote: String {
return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_quote")
}
/// Apply underline format
/// Apply strikethrough format
public static var wysiwygComposerFormatActionStrikethrough: String {
return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_strikethrough")
}
/// Decrease indentation
public static var wysiwygComposerFormatActionUnIndent: String {
return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_un_indent")
}
/// Apply strikethrough format
/// Apply underline format
public static var wysiwygComposerFormatActionUnderline: String {
return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_underline")
}
Expand Down
18 changes: 8 additions & 10 deletions RiotSwiftUI/Modules/Room/Composer/View/Composer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct Composer: View {
placeholder: viewModel.viewState.placeholder ?? "",
viewModel: wysiwygViewModel,
itemProviderHelper: nil,
keyCommandHandler: handleKeyCommand,
keyCommands: keyCommands,
pasteHandler: nil
)
.clipped()
Expand Down Expand Up @@ -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).
Expand Down
1 change: 1 addition & 0 deletions changelog.d/7752.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix dictation when using the Rich Text Editor
2 changes: 1 addition & 1 deletion project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ packages:
branch: 0.0.1
WysiwygComposer:
url: https://github.com/matrix-org/matrix-wysiwyg-composer-swift
version: 2.19.0
version: 2.29.0
DeviceKit:
url: https://github.com/devicekit/DeviceKit
majorVersion: 4.7.0
Expand Down

0 comments on commit 1dc609b

Please sign in to comment.