mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +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("") {
|
Button("") {
|
||||||
context.send(viewAction: .dismiss)
|
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: [])
|
.keyboardShortcut(.escape, modifiers: [])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
@@ -30,6 +30,7 @@ struct MessageComposerTextField: View {
|
|||||||
pasteHandler: pasteHandler)
|
pasteHandler: pasteHandler)
|
||||||
.accessibilityLabel(placeholder)
|
.accessibilityLabel(placeholder)
|
||||||
.background(placeholderView, alignment: .topLeading)
|
.background(placeholderView, alignment: .topLeading)
|
||||||
|
.background { keyboardShortcuts }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
@@ -41,6 +42,16 @@ struct MessageComposerTextField: View {
|
|||||||
.accessibilityHidden(true)
|
.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 {
|
private struct UITextViewWrapper: UIViewRepresentable {
|
||||||
|
|||||||
Reference in New Issue
Block a user