Skip to content

<Listbox> error: Uncaught Error: Maximum update depth exceeded. #3562

@breadadams

Description

@breadadams

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v2.2.0

What browser are you using?

Chrome 129.0.6668.59

Reproduction URL

Describe your issue

We've noticed the following error on the production version of our app: https://react.dev/errors/185?invariant=185

image

Local error message:

image

To reproduce it (on macOS) you need to be using a mouse that isn't a Magic Trackpad/Mouse, or set the "Show scroll bars" option in Settings to "Always":

image

Steps to reproduce:

  1. Open the listbox and select an option (e.g. the first one).
  2. The application should crash.

Worth mentioning that you can prevent the error from occurring by either of the following options:

  • Removing the overflow-auto from the element on L6.
  • Commenting out the label on L8.

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