I have this Form
with two TextField
‘s. When I attempt to use the copy paste shortcuts (CMD + C, CMD + V) within each TextField
, I hear the typical macOS system interrupt sound, with no changes to the text or my clipboard. How can I make copy and paste work?
Form {
TextField("Email", text: $userEmail)
.textFieldStyle(RoundedBorderTextFieldStyle())
.frame(width: 340, height: 35)
TextField("License Key", text: $userLicenseKey)
.textFieldStyle(RoundedBorderTextFieldStyle())
.frame(width: 380, height: 35)
}
Here is how I am displaying the LicenseView
:
func showConfigurationWindow() {
// Ensure the window exists; create if not
if configurationWindow == nil {
let hostingController = NSHostingController(rootView: ConfigurationView().frame(minWidth: 550, minHeight: 550))
configurationWindow = NSWindow(contentViewController: hostingController)
configurationWindow?.level = .normal
configurationWindow?.isReleasedWhenClosed = false
configurationWindow?.title = "Ocheeflow"
}
configurationWindow!.makeKeyAndOrderFront(nil)
NSApplication.shared.activate(ignoringOtherApps: true) // Focus the application
}
struct ConfigurationView: View {
var body: some View {
TabView {
VStack() {...}
VStack() {...}
VStack() {
LicenseView()
}
.tabItem {
Label("License", systemImage: "key")
.labelStyle(.titleAndIcon)
}
VStack() {...}
}
}