Replies: 5 comments 1 reply
-
That's a good idea, I can look into it definitely. |
Beta Was this translation helpful? Give feedback.
-
Alrighty, so I looked into it very quick and I reckon that this is something can be already achieved. You could define a new mutablestate in ur composable. val isFocused = remember { mutableState....} Add modifier to ur textfield .onFocusChanged { isFocused = it } On the textfield error isError = !isFocused & easyFormState.error = invalid. Sorry, I wrote this using my phone, I can update it tomorrow if u need more clarification. |
Beta Was this translation helpful? Give feedback.
-
Or better, use ur custom state so u do this once. There is already example how u can achieve this. |
Beta Was this translation helpful? Give feedback.
-
ok thanks! |
Beta Was this translation helpful? Give feedback.
-
added a quick example https://github.com/k0shk0sh/ComposeEasyForms/blob/main/app/src/main/java/com/github/k0shk0sh/compose/easyforms/example/custom_states/MyEasyFormsTextFieldFocusState.kt let me know if u need more info. |
Beta Was this translation helpful? Give feedback.
-
Are there any plans to handle onFocusChange at all? It's weird to have an error state when someone is typing text into the field.
Beta Was this translation helpful? Give feedback.
All reactions