From e792f722fa7b128969e0e63494745727e9f532d2 Mon Sep 17 00:00:00 2001 From: Radu Ursache Date: Fri, 12 Jun 2026 20:07:35 +0300 Subject: [PATCH] Fix 2FA code paste and macOS autofill in PIN code input Replace the six independently focused NSTextFields with a single invisible input field (contentType = .oneTimeCode) overlaying display-only digit boxes. All input now lands in one field, so pasting a full code works from any state and the system one-time code autofill from Messages/Mail inserts the whole code instead of breaking after the first digit when focus jumped between fields. Fixes XcodesOrg#587, fixes XcodesOrg#788 --- Xcodes/Frontend/SignIn/PinCodeTextView.swift | 307 +++++++++++-------- 1 file changed, 175 insertions(+), 132 deletions(-) diff --git a/Xcodes/Frontend/SignIn/PinCodeTextView.swift b/Xcodes/Frontend/SignIn/PinCodeTextView.swift index 6140cdd1..062a689b 100644 --- a/Xcodes/Frontend/SignIn/PinCodeTextView.swift +++ b/Xcodes/Frontend/SignIn/PinCodeTextView.swift @@ -14,16 +14,9 @@ struct PinCodeTextField: NSViewRepresentable { view.codeDidComplete = { complete($0) } return view } - + func updateNSView(_ nsView: NSViewType, context: Context) { - nsView.code = (0..