Skip to content

Combobox virtual feature randomly gives an error: Uncaught Error: Unexpected undefined at notUndefined at Virtualizer.getOffsetForIndex #3353

@JCMais

Description

@JCMais

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v2.1.1

What browser are you using?

Chrome, but does not matter

Reproduction URL

https://codesandbox.io/p/devbox/still-leftpad-xr4zpk?file=%2Fsrc%2FCombobox.jsx&embed=1

Steps to reproduce:

  1. click the field
  2. clear the input (type "a")
  3. press enter
  4. error happens

Describe your issue
I am randomly getting the error: Error: Unexpected undefined when the list is empty.

image

I think one possible fix here is to bump the @tanstack/react-virtual package to the latest version and disable the virtualizer when the list is empty

This is related to this ticket TanStack/virtual#696 and the related link PR: TanStack/virtual#741

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions