Skip to content

SelectPanel synchronizes selection and loading state from effects #8607

Description

@alexus37

Description

SelectPanel synchronizes intermediate selection, loading state, and selected-item ordering from passive effects. These effects can call multiple state setters during commit, producing cascading follow-up renders on pages that mount closed or data-backed SelectPanels.

Expected behavior: SelectPanel should preserve controlled/uncontrolled selection and loading semantics without avoidable commit-spawned updates.

Steps to reproduce

  1. Render closed SelectPanels with empty and preloaded item arrays in a React 19 profiling build.
  2. Change items, open, and controlled selection values.
  3. Record commits in Chrome DevTools.
  4. Observe state publication from the selection/loading/sort synchronization effects.

Version

@primer/react 38.42.0

Browser

Chrome

Acceptance criteria

  • Preserve loading announcements and selected-item ordering.
  • Preserve modal intermediate selection behavior.
  • Add tests for mount, open/close, item arrival, and controlled selection changes.
  • Fix this in Primer React rather than requiring a downstream patch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions