Closed kusab85 closed 1 year ago
You shouldn't use $field->value
as we need to determine whether it is undefined or null from dependsOn
. You should be able to get the current value from $formData
.
So, if I stop reading $field->value
on server side the form field will stop resetting on client side? That's quite inobvious behavior ;-)
This this in Nova repository hasn't failed yet, which should have if what you claimed did happened.
So @crynobone, please tell me if I'm misreading the test_it_reset_the_field_value
test entirely.
The expected behavior of dependent BelongsTo
field is to reset to its original value (null on creating) as soon as field on which it depends on changes its value?
Description:
Value of BelongsTo field resets to its initial value when dependsOn other field.
Initial state of form (creating new post)
Selecting a user
Setting creation date
Form state after creation date setting
Detailed steps to reproduce the issue on a fresh Nova installation:
Check reproduction repository.