Set value of another field from within default
Can I set the value of the
key
from within the default of the name
. Ideally I don't want to duplicate the logic fetching the default name
.
If you put the key
input first it works. I think the default
is getting called before all the fields are registered is there a way around this?5 Replies
Possibly
afterStateHydrated()
instead of default()
Tried that but unfortunately the key value is not getting set.
I'm using those fields inside
createOptionForm
and I don't think there's an afterFill
hook equivalent.lol, I was just going to suggest afterFill
Can you subclass the Select field and override
getCreateOptionAction()
?
I think you would be able to add a afterFormFilled()
hook to itYou've led me to
modifyCreateOptionActionUsing
just going to see if I can get that working.
That wasn't working but I figured I could get the value instead. Spent too long trying to get it to work the other way around.
Nice and simple π