mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Fix keyboard escape key not working for cancelling edits and replies on the Mac
This commit is contained in:
committed by
Stefan Ceriu
parent
783eab2a8a
commit
45ac47ce16
@@ -103,7 +103,7 @@ struct GlobalSearchScreen: View {
|
||||
Button("") {
|
||||
context.send(viewAction: .dismiss)
|
||||
}
|
||||
// Need this to enable escape on the textfield and forward the presses
|
||||
// Need this to enable escape on the textField and forward the presses
|
||||
.keyboardShortcut(.escape, modifiers: [])
|
||||
}
|
||||
}
|
||||
|
||||
+11
@@ -30,6 +30,7 @@ struct MessageComposerTextField: View {
|
||||
pasteHandler: pasteHandler)
|
||||
.accessibilityLabel(placeholder)
|
||||
.background(placeholderView, alignment: .topLeading)
|
||||
.background { keyboardShortcuts }
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
@@ -41,6 +42,16 @@ struct MessageComposerTextField: View {
|
||||
.accessibilityHidden(true)
|
||||
}
|
||||
}
|
||||
|
||||
private var keyboardShortcuts: some View {
|
||||
Group {
|
||||
Button("") {
|
||||
keyHandler(.keyboardEscape)
|
||||
}
|
||||
// Need this to enable escape on the textView and forward the presses
|
||||
.keyboardShortcut(.escape, modifiers: [])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct UITextViewWrapper: UIViewRepresentable {
|
||||
|
||||
Reference in New Issue
Block a user