jverdi / JVFloatLabeledTextField

UITextField subclass with floating labels - inspired by Matt D. Smith's design: http://dribbble.com/shots/1254439--GIF-Mobile-Form-Interaction?list=users
MIT License
7.19k stars 732 forks source link

Accessibility label on text field is no longer nil when there is no text #227

Closed josher8 closed 1 year ago

josher8 commented 1 year ago

The text fields accessibility label only got set when text was entered, and changed to nil when there was no text. This change adds it in the setFloatingText method on init.

jverdi commented 1 year ago

Hey Josh. Thanks for the contribution. it looks like the change was made as part of this PR: https://github.com/jverdi/JVFloatLabeledTextField/pull/217

The goal seemed to be to ensure the label was still read aloud once text was entered in the field

josher8 commented 1 year ago

Hey Josh. Thanks for the contribution. it looks like the change was made as part of this PR: #217

The goal seemed to be to ensure the label was still read aloud once text was entered in the field

Hello! On that PR, it still reads it on the voice reader. But if you have no text, and go into the accessibility inspector, you can see the accessibility label is nil. I tested this change on the voice reader, and it is still reading the label correctly. It now shows the accessibility label in the inspector.

jverdi commented 1 year ago

Got it. Thanks for that added context. Yeah I think we can go ahead and merge. Thanks again for the contribution!