hperrin / svelte-material-ui

Svelte Material UI Components
https://sveltematerialui.com/
Apache License 2.0
3.32k stars 285 forks source link

Accordions can not be nested #436

Closed choofy closed 2 years ago

choofy commented 2 years ago

Describe the bug I have an accordion consisting of 1 panel, and on that panel, I have another accordion. Opening the outer panel goes fine, but then when I try to open the panel of the inner accordion, it does not open.

To Reproduce Steps to reproduce the behavior:

  1. Create and accordion within the panel of another accordion
  2. Open the outer accordion by clicking on its header
  3. Click on the header of the inner accordion
  4. See error: Inner accordion does not open

Expected behavior Accordions within other accordions respond properly (independently of their outer accordion).

Desktop (please complete the following information):

Additional context Cause could be that accordions use getContext/setContext for the "open" flag. Because contexts are accessible for all child nodes, the inner accordion uses the same "open" flag as the outer accordion. This is suspicious.

CryptAlchemy commented 2 years ago

Bump

Repl with unexpected behavior: https://svelte.dev/repl/03b6e62f865d42f3adc6e6923ad6dbd7?version=3.37.0