Skip to content

Commit 5d09cb0

Browse files
committed
Improve VoiceOver navigation for text field rows
1 parent 1b00c1f commit 5d09cb0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Authenticator/Source/TextFieldRow.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ class TextFieldRowCell<Action>: UITableViewCell, UITextFieldDelegate {
7373
textField.borderStyle = .roundedRect
7474
textField.font = UIFont.systemFont(ofSize: 16, weight: UIFontWeightLight)
7575
contentView.addSubview(textField)
76+
77+
accessibilityElements = [textField]
7678
}
7779

7880
override func layoutSubviews() {
@@ -101,6 +103,8 @@ class TextFieldRowCell<Action>: UITableViewCell, UITextFieldDelegate {
101103
textField.text = viewModel.value
102104
}
103105
changeAction = viewModel.changeAction
106+
107+
textField.accessibilityLabel = viewModel.label
104108
}
105109

106110
static func heightWithViewModel(_ viewModel: TextFieldRowViewModel<Action>) -> CGFloat {

0 commit comments

Comments
 (0)