-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
- Laravel Version: 9.45.1
- Nova Version: 4.19.5 (Silver Surfer)
- PHP Version: 8.0.11
- Database Driver & Version: SQL lite
- Operating System and Version: Windows 10 22H2
- Browser type and version: FF, Chrome
- Reproduction Repository: https://github.com/kusab85/TestApp/tree/nova-BelongsTo-resets-with-dependsOn
Description:
Value of BelongsTo field resets to its initial value when dependsOn itself.
/**
* App/Nova/Post.php
*/
public function fields(NovaRequest $request)
{
return [
// [...]
BelongsTo::make('User')
->dependsOn(
['user'],
function (BelongsTo $field, NovaRequest $request, FormData $formData) {
$field->help(
'$formData->user = '.var_export($formData->user, true).' '.
'$field->value = '.var_export($field->value, true)
);
}),
// [...]
];
}1. Initial state of form field

3. Form field state after new user selection

Detailed steps to reproduce the issue on a fresh Nova installation:
Check reproduction repository.
Metadata
Metadata
Assignees
Labels
No labels
