Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dictation when using the Rich Text Editor. #7752

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading