Skip to content

[bug]: Combobox.Item causes re-render on hover #29

Open
@kelvinlingsf

Description

@kelvinlingsf

Describe the bug

Combobox.Item causes a whole combobox re-render when the mouse hovers above it
If the list is big it'll cause quite a significant drop in the FPS

This is probably caused by this event handler causing an unintended state update causing React to re-render on mouse hover:

onPointerMove={composeEventHandlers(itemProps.onPointerMove, () => {

How to reproduce

I've reproduced the bug in this repo:

https://codesandbox.io/p/devbox/divine-resonance-gzdwvn

Link to direct demo:

https://gzdwvn-5173.csb.app/

  1. Open the Combobox
  2. Turn on react-scan
  3. Hover on any item inside

Link to reproduction

https://codesandbox.io/p/devbox/divine-resonance-gzdwvn

Additional information

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions