components icon indicating copy to clipboard operation
components copied to clipboard

[Bug]: Autosuggest's `focus` function does not always work

Open drewdh opened this issue 10 months ago • 2 comments

Browser

Chrome

Package version

3.0.615

React version

18.2.0

Description

On initial mount, calling the focus function of the autosuggest component, even though defined, has no effect. If the component is remounted, calling focus works as expected.

Source code

See CodeSandbox below.

Reproduction

https://codesandbox.io/p/sandbox/autosuggest-focus-bug-vdszv6?file=%2Fsrc%2FApp.tsx

  1. Open the preview in a wide enough screen that the search slot content of the TopNavigation is visible on the first render.
  2. Click the "Focus" button. See that the ref's focus method was called, but the component was not focused.
  3. Reduce the width of the screen so the search slot content is hidden.
  4. Widen the screen so the search slot content is visible again.
  5. Click "Focus" and see the component was focused.

Code of Conduct

drewdh avatar Apr 21 '24 21:04 drewdh

Hi, I’m just checking in on this issue as it’s impacting our current project timeline. Is there any update, or is there any additional information I could provide to assist? I'm also happy to help with debugging or testing if needed.

drewdh avatar May 02 '24 03:05 drewdh

Hello,

Apologies for the late reply and many thanks for providing a reproducible example. No additional information is needed - our team will take a look at the problem and keep you posted.

pan-kot avatar May 03 '24 10:05 pan-kot

A fix for this has now been released

gethinwebster avatar May 08 '24 08:05 gethinwebster