Skip to content

Encountering this.$refs.searchable.close is not a function Error When Filtering Relationships on Index Page #6189

@mostafaznv

Description

@mostafaznv
  • Laravel Version: 10.43.0
  • Nova Version: 4.32.11
  • PHP Version: 8.3.2
  • Database Driver & Version: Mysql 8.0.33
  • Operating System and Version: MacOS 14.2.1
  • Browser type and version: Google Chrome 121.0.6167.160
  • Reproduction Repository: https://github.com/mostafaznv/nova-searchable-filters-bug



Description:

I'm facing an issue with belongsTo relationships in my Nova resources.
If I enable the searchable method on the belongsTo field, the filter box crashes, and I receive a console error.
These fields work fine when I want to create/update an item on the add/edit pages.
However, when I attempt to filter results on the index page, the filter box crashes, and I receive a console error.

image




Reproduction Steps:

  1. Clone the repository
  2. Open the .env file and set your database credentials (DB_DATABASE, DB_USERNAME, DB_PASSWORD)
  3. Open the .env file and set your NOVA_LICENSE_KEY
  4. Run composer install
  5. Migrate and seed the database using the following command:
    php artisan migrate:fresh --seed
  6. Run the server using the following command:
    php artisan serve
  7. Visit the admin panel by going to http://127.0.0.1:8000/nova
  8. Your credentials are:
    • Email: admin@nova.com
    • Password: password
  9. Open the inspect element tool in Chrome/Firefox and navigate to the console tab
  10. Go to the Article resource and try to filter the results using the User/Category filter.
  11. Boom! You will see the error in the console, and the filter box will crash until you close it or refresh the page.

Related To: #6118

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified bug by the Nova team

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions