Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - <Listbox dynamicCollections /> #4277

Closed
kaitoukid-1412 opened this issue Dec 8, 2024 · 1 comment · Fixed by #4369
Closed

[BUG] - <Listbox dynamicCollections /> #4277

kaitoukid-1412 opened this issue Dec 8, 2024 · 1 comment · Fixed by #4369

Comments

@kaitoukid-1412
Copy link

NextUI Version

2.6.4

Describe the bug

https://nextui.org/docs/components/listbox#dynamic-items
https://react-spectrum.adobe.com/react-stately/collections.html#dynamic-collections

{4C6826F9-29C6-48CB-B58B-8AF6DD3847E4}
Untitled

import { Listbox, ListboxItem, ListboxSection } from '@nextui-org/react'

const items = [
  {
    items: [{ name: 'David1' }, { name: 'Same1' }, { name: 'Jane1' }],
    name: 'Aardv888888888888ark'
  },
  { items: [{ name: 'David2' }, { name: 'Same2' }, { name: 'Jane2' }], name: 'Kangaroo' },
  { items: [{ name: 'David3' }, { name: 'Same3' }, { name: 'Jane3' }], name: 'Snake' }
].map((a, id) => ({ id, ...a }))

export const Page = () => {
  return (
    <Listbox aria-label='dd' items={items}>
      {section => (
        <ListboxSection items={section.items} key={section.name} title={section.name}>
          {item => <ListboxItem key={item.name}>{item.name}</ListboxItem>}
        </ListboxSection>
      )}
    </Listbox>
  )
}

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

123

Expected behavior

456

Screenshots or Videos

No response

Operating System Version

123

Browser

Chrome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant