You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the scenario where I want to set one model value based on some computation of another model value.
A phone preference type ('Mobile', 'Work', 'Home') and a mobile phone number.
Both values are optional, and therefore could be blank.
If the mobile phone number is complete and valid, I want the phone preference to be set to 'mobile'.
If I want to do this on the blur of the mobile phone field - I can't. Why:
a) I can override the onBlur of the mobile phone field over Form-containers' but I'd have to replicate what form-container is doing, as it's not exposed on the interface to call it.
b) Although the form-config allows a 'global' onBlur event, it's outside the implementing class, and therefore has no access to the model etc.
I could have used 'getValue()' but that's not exposed on the interface.
c) I can override the onChange event, and then call form-containers' one, but the model on the props doesn't reflect the update of the model, validation etc that may happen when form-containers' is called. (It's one cycle behind).
There's no real opportunity to achieve the above unfortunately.
The text was updated successfully, but these errors were encountered:
I have the scenario where I want to set one model value based on some computation of another model value.
A phone preference type ('Mobile', 'Work', 'Home') and a mobile phone number.
Both values are optional, and therefore could be blank.
If the mobile phone number is complete and valid, I want the phone preference to be set to 'mobile'.
If I want to do this on the blur of the mobile phone field - I can't. Why:
a) I can override the onBlur of the mobile phone field over Form-containers' but I'd have to replicate what form-container is doing, as it's not exposed on the interface to call it.
b) Although the form-config allows a 'global' onBlur event, it's outside the implementing class, and therefore has no access to the model etc.
I could have used 'getValue()' but that's not exposed on the interface.
c) I can override the onChange event, and then call form-containers' one, but the model on the props doesn't reflect the update of the model, validation etc that may happen when form-containers' is called. (It's one cycle behind).
There's no real opportunity to achieve the above unfortunately.
The text was updated successfully, but these errors were encountered: