Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searchable input not cleared #5897

Closed
Keko-94 opened this issue Sep 20, 2023 · 3 comments
Closed

Searchable input not cleared #5897

Keko-94 opened this issue Sep 20, 2023 · 3 comments
Assignees
Labels
bug Verified bug by the Nova team

Comments

@Keko-94
Copy link

Keko-94 commented Sep 20, 2023

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
Copy link
Author

Keko-94 commented Oct 16, 2023

(Issue persists in the latest release v4.27.14)

@crynobone crynobone added the pending Issues that are pending triage label Oct 16, 2023
@jeremynikolic jeremynikolic self-assigned this Aug 7, 2024
@jeremynikolic
Copy link

@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 jeremynikolic added bug Verified bug by the Nova team and removed pending Issues that are pending triage labels Aug 7, 2024
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Verified bug by the Nova team
Projects
None yet
Development

No branches or pull requests

3 participants