I need some help with two input that depends on each other
The first image shows the use case: I want to preselect an option if the select has only one option available.
I tried to use the forn.setFieldValue on the form field listeners or the onChange but I was getting different issues with those options
There's an standard way to watch for an input value and if the input changes I check on a list, it could be a fetch from and endpoint or a json and I want to set the value from that json


3 Replies
correct-apricotOP•7d ago
Forget it — I just had to use onChangeDebounceMs. I suppose the issue was that I wasn’t using await with the fetch call, and without await the value isn’t set at the moment I try to update the field. So we need to wait a little. I’d prefer to have a cleaner way to handle that:
also I had to use a form subscribe:
like-gold•6d ago
Looks like you managed to find a workaround yourself. However, I'll still answer this comment:
There's an standard way to watch for an input valueThere is. You can use
useStore
correct-apricotOP•6d ago
cool thanks! I'm going to check how I can update my form to use that