mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Accept current autocorrection/suggestion before sending a message (#3219)
* Fixes #3216 - Accept current autocorrection/suggestion before sending a message. * Switch from a temporary textField to `inputDelegate` selection changes
This commit is contained in:
@@ -23,6 +23,7 @@ typealias PasteHandler = (NSItemProvider) -> Void
|
||||
|
||||
struct MessageComposer: View {
|
||||
@Binding var plainComposerText: NSAttributedString
|
||||
@Binding var presendCallback: (() -> Void)?
|
||||
let composerView: WysiwygComposerView
|
||||
let mode: ComposerMode
|
||||
let composerFormattingEnabled: Bool
|
||||
@@ -86,6 +87,7 @@ struct MessageComposer: View {
|
||||
} else {
|
||||
MessageComposerTextField(placeholder: L10n.richTextEditorComposerPlaceholder,
|
||||
text: $plainComposerText,
|
||||
presendCallback: $presendCallback,
|
||||
maxHeight: 300,
|
||||
keyHandler: { handleKeyPress($0) },
|
||||
pasteHandler: pasteAction)
|
||||
@@ -253,6 +255,7 @@ struct MessageComposer_Previews: PreviewProvider, TestablePreview {
|
||||
pasteHandler: nil)
|
||||
|
||||
return MessageComposer(plainComposerText: .constant(content),
|
||||
presendCallback: .constant(nil),
|
||||
composerView: composerView,
|
||||
mode: mode,
|
||||
composerFormattingEnabled: false,
|
||||
|
||||
Reference in New Issue
Block a user