Fix mislabeled trait bit 47 (textArea) and add secureTextField (bit 24)#327
Merged
RoyalPineapple merged 8 commits intomainfrom Mar 30, 2026
Merged
Fix mislabeled trait bit 47 (textArea) and add secureTextField (bit 24)#327RoyalPineapple merged 8 commits intomainfrom
RoyalPineapple merged 8 commits intomainfrom
Conversation
…crollable Bit 47 (0x800000000000) of UIAccessibilityTraits is Apple's private UIAccessibilityTraitTextArea, used by UITextView/TextEditor. It was incorrectly named "scrollable" when introduced in #186. The logic was correct (distinguishing UITextView from UITextField) but the naming was wrong, causing incorrect serialization and misleading code semantics. Renames the trait, updates Codable encoding, and fixes localization keys. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ate traits Adds handling for the private secureTextField trait (bit 24, AXTraitSecureTextField) so SecureField/secure UITextField elements are announced as "Secure Text Field." matching VoiceOver behavior, instead of the generic "Text Field." specifier. Also adds a source citation comment for all private trait bit positions, referencing AXRuntime.framework symbols as extracted in facebook/idb PrivateHeaders/AXRuntime/AXTraits.h. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a SwiftUISecureField demo view with empty and populated SecureField alongside a regular TextField for comparison, and a corresponding snapshot test. Confirms the secureTextField trait (bit 24) produces the correct "Secure Text Field." specifier distinct from "Text Field." Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds SecureField (empty and populated) to the SwiftUITextEntry demo view instead of a separate file, so all text entry variants (TextField, SecureField, TextEditor) are tested together. Updates reference images. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Consolidates bit position, hex value, name, and UIKit source into a single reference table above the trait definitions for quick lookup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
soroushsq
approved these changes
Mar 30, 2026
…lity+SnapshotAdditions.swift Co-authored-by: Soroush Khanlou <soroush@squareup.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two issues with private
UIAccessibilityTraitshandling:Bit 47:
scrollable→textAreaThe private trait at bit 47 (
0x800000000000) was incorrectly namedscrollablewhen it is actually Apple'sAXTraitTextArea, set onUITextViewand SwiftUITextEditor. The detection logic was already correct (introduced in #186), but the label was wrong. This renames it totextAreaacross:Bit 24: new
secureTextFieldtraitAdds handling for
AXTraitSecureTextField(bit 24,0x1000000) so thatSecureFieldand secureUITextFieldelements are announced as "Secure Text Field." instead of the generic "Text Field.", matching VoiceOver behavior.Source citation
Adds a comment citing
AXRuntime.frameworksymbols (via facebook/idbAXTraits.h) as the authoritative reference for private trait bit positions.Test plan
xcodebuild buildsucceeds🤖 Generated with Claude Code