Skip to content

[BUG] - Newly added dynamic accordion item doesnt open on click #5825

@Szulerinio

Description

@Szulerinio

HeroUI Version

2.8.5

Describe the bug

If accordion items are dynamic. mapped from an array of elements, then sometimes newly added items don't trigger open on click
The issue resolves if the accordion is interacted with in other way, then the new element becomes interactable

In the docs I didn't notice any example with dynamic accordion items, but didn't see any information not to do that too. If this is not intended use, please add (more visible) info in the docs

Your Example Website or App

https://stackblitz.com/edit/asbmg3qu?file=App.jsx

Steps to Reproduce the Bug or Issue

  1. Go to reproduction
  2. open some accordion item
  3. click "add one"
  4. try clicking on the last element in the list
  5. if issue didn't occur, repeat steps 3 and 4.
  6. if it still didn't occur, try adding few elements and only then clicking the last one

usually the problem occurs at 1st-3rd try
It happened to me on Chrome and Opera

Expected behavior

Newly added elements should be immediately interactive

Screenshots or Videos

No response

Operating System Version

Windows 10 and Mac OS

Browser

Chrome

Metadata

Metadata

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