Hi, I have multiple textfields that can be errored...
# compose
a
Hi, I have multiple textfields that can be errored, and I have a button to validate everything, and I want to only enable the validate button when no fields are errored, so I created a first-class array of strings, and when an field is errored, the name of the field is added to the array, and my button has the property
enabled = array.isEmpty()
but the problem is that the button enabled state is only updated after the array has changed Like if I have a field errored, the array has correctly a new value inside, but the button is only updated when the list is updated after this (like adding/removing an element), not directly when a new element is added to array
a
Is your array a mutable state?
a
Yes, it's a
mutableStateListOf<String>()
a
Then file an issue with a repro.
a
Oh it's really a bug of Compose ?
a
You are not posting any code but from what you described, yes.
a
Ah, while re-reading my code, I've seen that I misplaced the line where I add the error, and now it is fixed, thanks for support nonetheless ^^