Skip to content

Collapsible does not always handle growing children #7318

@Bringer128

Description

@Bringer128

Issue summary

Collapsible occasionally does not recompute the size of its children even if they change their size appropriately within the React event cycle.

Expected behavior

As the children grow, all expanded Collapsible containers show their children

Actual behavior

Gif recording of last Collapsible element not resizing

Steps to reproduce the problem

A reproduction scenario is here

If you want to recreate the repro:

  1. Build a component that grows every second
  2. In another component, have a button to add a Collapsible with the growing element inside.
  3. Then click this button any number of times; the last added Collapsible will not grow but the others will

Reduced test case

See the problem here: https://codesandbox.io/s/quiet-leaf-bsrk37?file=/App.js

Specifications

  • Are you using the React components? (Y/N): Yes
  • Polaris version number: 10.4.1
  • Browser: Google Chrome
  • Device: MacBook Pro (14-inch, 2021); Apple M1 Pro
  • Operating System: MacOS Monterey 12.6 (21G115)

Metadata

Metadata

Assignees

No one assigned

    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