Skip to content

Commit 301f9f0

Browse files
authored
Merge pull request #227 from josher8/Accessibility-Fix
Accessibility label on text field is no longer nil when there is no text
2 parents 1fd3fb8 + 811bf17 commit 301f9f0

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

JVFloatLabeledTextField/JVFloatLabeledTextField/JVFloatLabeledTextField.m

+1-4
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ - (void)showFloatingLabel:(BOOL)animated
148148
else {
149149
showBlock();
150150
}
151-
152-
self.accessibilityLabel = self.floatingLabel.text;
153151
}
154152

155153
- (void)hideFloatingLabel:(BOOL)animated
@@ -173,8 +171,6 @@ - (void)hideFloatingLabel:(BOOL)animated
173171
else {
174172
hideBlock();
175173
}
176-
177-
self.accessibilityLabel = nil;
178174
}
179175

180176
- (void)setLabelOriginForTextAlignment
@@ -202,6 +198,7 @@ - (void)setLabelOriginForTextAlignment
202198

203199
- (void)setFloatingLabelText:(NSString *)text
204200
{
201+
self.accessibilityLabel = text;
205202
_floatingLabel.text = text;
206203
[self setNeedsLayout];
207204
}

0 commit comments

Comments
 (0)