From 39be0dcfde5d6dcb28b5ed069ba40dbc2d83aeb9 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Tue, 16 Jun 2026 15:25:56 +0200 Subject: [PATCH] Set pin a11y improvements --- .../AppLockSetupPINScreen/View/AppLockSetupPINScreen.swift | 1 + .../AppLock/AppLockSetupPINScreen/View/PINTextField.swift | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/View/AppLockSetupPINScreen.swift b/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/View/AppLockSetupPINScreen.swift index 573713896..d0e9440d6 100644 --- a/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/View/AppLockSetupPINScreen.swift +++ b/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/View/AppLockSetupPINScreen.swift @@ -66,6 +66,7 @@ struct AppLockSetupPINScreen: View { .font(.compound.headingMDBold) .multilineTextAlignment(.center) .foregroundColor(.compound.textPrimary) + .accessibilityAddTraits(.isHeader) Text(context.viewState.subtitle) .font(.compound.bodyMD) diff --git a/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/View/PINTextField.swift b/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/View/PINTextField.swift index cbd2c7d72..595a5e82d 100644 --- a/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/View/PINTextField.swift +++ b/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/View/PINTextField.swift @@ -20,6 +20,8 @@ struct PINTextField: View { textField .textFieldStyle(PINTextFieldStyle(pinCode: pinCode, isSecure: isSecure, maxLength: maxLength, size: size)) .keyboardType(.numberPad) + // Keep the label persistent: the field's title behaves as a placeholder and is only announced while empty. + .accessibilityLabel(L10n.a11yPinField) .accessibilityIdentifier(A11yIdentifiers.appLockSetupPINScreen.textField) .onChange(of: pinCode) { _, newValue in let sanitized = sanitize(newValue)