mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: allow submitting clipboard confirmation with return
Before this change I couldn't submit the dialog with return. Or cmd+return. From what I understand the problem was that the `TextEditor` always steals the default focus. I tried a bunch of workarounds I found to set the default focus on the button, but none of them worked. Then I thought: do we even need a full-on Text*Editor*? So I switched `TextEditor` to `Text` with a `ScrollView`: things look the same, text is selectable and scrollable, but I can hit return to submit the dialog.
This commit is contained in:
@ -48,10 +48,12 @@ struct ClipboardConfirmationView: View {
|
|||||||
.padding()
|
.padding()
|
||||||
}
|
}
|
||||||
|
|
||||||
TextEditor(text: .constant(contents))
|
ScrollView {
|
||||||
.textSelection(.enabled)
|
Text(contents)
|
||||||
.font(.system(.body, design: .monospaced))
|
.textSelection(.enabled)
|
||||||
.padding(.all, 4)
|
.font(.system(.body, design: .monospaced))
|
||||||
|
.padding(.all, 4)
|
||||||
|
}
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
Spacer()
|
Spacer()
|
||||||
|
Reference in New Issue
Block a user