nova-issues icon indicating copy to clipboard operation
nova-issues copied to clipboard

Searchable input not cleared

Open Keko-94 opened this issue 1 year ago • 1 comments

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);
                })

Keko-94 avatar Sep 20 '23 15:09 Keko-94

(Issue persists in the latest release v4.27.14)

Keko-94 avatar Oct 16 '23 09:10 Keko-94

@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

jeremynikolic avatar Aug 07 '24 12:08 jeremynikolic

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.

github-actions[bot] avatar Aug 14 '24 00:08 github-actions[bot]