components
components copied to clipboard
[Bug]: Autosuggest's `focus` function does not always work
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
- Open the preview in a wide enough screen that the
search
slot content of the TopNavigation is visible on the first render. - Click the "Focus" button. See that the ref's focus method was called, but the component was not focused.
- Reduce the width of the screen so the
search
slot content is hidden. - Widen the screen so the
search
slot content is visible again. - Click "Focus" and see the component was focused.
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
- [X] I checked the current issues for duplicate problems
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.
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.
A fix for this has now been released