nova-issues
nova-issues copied to clipboard
Searchable input not cleared
Laravel Version: 10.24
Nova Version: 4.27.13
PHP Version: 8.1
Database Driver & Version: MariaDB
Operating System and Version: Win10
Browser type and version: Firefox 117
Repo URL: https://github.com/Keko-94/nova-clean
Description:
Calling $field->setValue(null) doesn't clear the input. https://github.com/laravel/nova-issues/assets/62820283/f6b267e0-1a95-4b6b-8b23-cbd679afc1f2
Detailed steps to reproduce the issue on a fresh Nova installation:
Add those fields in the User Resource:
Select::make('Size')->options([
'S' => 'Small',
'M' => 'Medium',
'L' => 'Large',
]),
BelongsTo::make('Post')
->hide()
->nullable()
->searchable()
->showCreateRelationButton()
->dependsOn('size', function (BelongsTo $field, NovaRequest $request, FormData $formData) {
if ($formData->size === 'S') {
$field->show();
} else {
$field->setValue(null);
}
}),
Text::make('Post Value')
->dependsOn('post', function (Text $field, NovaRequest $request, FormData $formData) {
$field->setValue($formData->post);
})
(Issue persists in the latest release v4.27.14)
@Keko-94 the issue is now be fixed please try with latest v4.35.0 🙏 In case the issue persist please open a new issue with updated information as we could not reproduce in latest version
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.