Search broken without search_api_autocomplete

Created on 21 January 2025, 3 months ago

Problem/Motivation

When looking at 📌 Try to load autocomplete and other js when the search button is clicked Active and 🐛 Front-end Performance Suggestions (Via Google Lighthouse) Active I uninstalled search_api_autocomplete to compare. When I do this, the search menu item doesn't work at all.

search-wide.js?sqep6r:86 Uncaught TypeError: Cannot read properties of null (reading 'focus')
    at HTMLDivElement.handleFocus (search-wide.js?sqep6r:86:81)

Clicking the search menu item opens the dropdown, the theming is off, then clicking in the box, instead of allowing me to type, takes me immediately to the search page.

While the search recipe includes search_api_autocomplete without an option not to, site admins can go to extend and uninstall modules, and this shouldn't completely break the theme - it should just remove the autocomplete.

Making it optional was discussed in 📌 Add recipe for search backend Active but unfortunately not implemented.

Steps to reproduce

Proposed resolution

User interface changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Component

Olivero

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @catch
  • 🇦🇺Australia pameeela

    Hmm, yeah, I agree. The reason it wasn't made optional is that we don't have a great way to provide the option to users within the one recipe, and I think having a separate recipe just for autocomplete would be somewhat odd.

    First thing I guess it to determine whether it actually can be provided as an optional add-on, even if it's a separate recipe? In some cases, things can't be split because there is no way to manipulate the config as is necessary.

  • 🇬🇧United Kingdom catch

    This isn't only an issue if you uninstall search_api_autocomplete from the recipe, it also prevents configuring search_api + simple_search_form manually, making Drupal CMS essentially incompatible with those modules unless you also use search_api_autocomplete (including via an alternative recipe if one existed). Bumping to critical.

Production build 0.71.5 2024