Hi! Is there a way to set textContentType (usernam...
# compose-ios
ł
Hi! Is there a way to set textContentType (username / password) in compose textfields on iOS? I can see that it has something to do with implementing SkikoUITextInputTraits but I have no idea how to even start setting it in a single text field. My aim is to enable autofill this way.
k
to show ** you can use PasswordVisualTransformation() and toggle it on of with a button and use VisualTransformation.None if toggled of and to set the correct keyboard type you can use keyboard options like so
Copy code
KeyboardOptions.Default.copy(keyboardType = KeyboardType.Password)
ł
@Kilian yes I have it this way. But the keyboard settings do not change autofill behavior and user can't fill in the form using saved username/password.
m
Resurrecting this old-ish question. Has anyone been able to set textContentType, so we can offer password pre-fill? 🙏
a
@Michal Srutek KeyboardType.Password together with configured associated domain should be enough, isn't it?
a
I can see that when I tried to do this that the platform recognizes the autofill for the textfield on the password after, but when actually autofilling it omits the email even though I set the keyboard type to email. Seems like something that we might have to actually create a composable wrapping the swiftui text field to achieve setting content type? There was an example wrapping a text field in the docs, but obviously wouldn't be styled to every other text field in my app with that approach https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-uikit-integration.html#use-uikit-inside-compose-multiplatform
m
I've found using the experimental autofill compose api mostly works on iOS https://medium.com/@bagadeshrp/compose-ui-textfield-autofill-6e2ac434e380
m