autocomplete: detachedMediaQuery doesn't persist setQuery in the search bar input

Description

In a React implementation of autocomplete, when setting the query in an item’s onSelect, it does not persist in the search bar input’s value when you have detachedMediaQuery always on (detachedMediaQuery: '').

Reproduction

https://codesandbox.io/s/react-algolia-autocomplete-2-u9wqv?file=/src/App.js

Steps

  1. Click on the search bar
  2. Scroll to the “Can’t find what you’re looking for?” section at the bottom
  3. Click one of the query suggestions, like ‘macbook’
  4. Scroll back up to see the search bar input. The search bar input should be blank.

Expected behavior

The value in the search bar input should persist when updating the query via setQuery in an onSelect, even if detached mode is on.

Environment

  • OS: macOS
  • Browser: Chrome, Safari, Firefox
  • Autocomplete version: 1.1.0

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (7 by maintainers)

Most upvoted comments

Yeah, it should fill the query with the item’s value. We’ll investigate why this happens. Thanks again.

Hi everyone! 👋

A fix to this issue has been released in v1.8.3.

→ Try it here

@goxmedia the issue will be fixed once it’s closed here, not before that.

@seafoox Until this issue is fixed, we are unable to use the Query Suggestions or Recent Searches plugins within our Autocomplete config. This is undesirable for our user experience.

Can you please provide a timeline on when this issue will be fixed?

Thanks is advance.

There issue is currently being looked by the Autocomplete core team, but no proper resolution method have been found at this stage. We’ll keep you posted once we have a solution ready.