Replies: 1 comment
-
I'm trying to do the same thing. I think headlessui/packages/@headlessui-react/src/components/listbox/listbox.tsx Lines 153 to 158 in 1469b85 My current hack is to leave <Listbox
value={[]}
onChange={() => void}
multiple={true}
as='div'
>
+ <Listbox.Button autoFocus></Listbox.Button>
<Listbox.Options static={true}>
{options.map((o) => (
<Listbox.Option
key={o.id}
className={({ active }) =>
`${
active ? 'some classes when active' : 'some classes when not active'
}`
}
value={o}
>
{o.name}
</Listbox.Option>
))}
</Listbox.Options>
</Listbox> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I work on customized Listbox where options are always expanded. I used static prop on <Listbox.Options> tag to achieve that. But when I have static={true}, than render prop active on individual Listbox.Option is always false. Can you help me how to solve this ? Thanks.
Simplified code example:
Beta Was this translation helpful? Give feedback.
All reactions