Skip to content

Listbox with DialogTrigger #2153

Answered by snowystinger
chrisphillers asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah, you don't have anything picking up the Slot in the ListBox https://codesandbox.io/s/react-spectrum-sandbox-forked-rcqik?file=/src/listbox.js See https://react-spectrum.adobe.com/react-spectrum/ListBox.html#complex-items and https://react-spectrum.adobe.com/react-spectrum/layout.html#slots
On another note, a ListBox can't have interactive components in a List Item, you should remove the ActionButtons and just render the item as the label, then use a handler on the ListBox for onSelectionChange, to change the state of the dialog being shown

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@chrisphillers
Comment options

Answer selected by snowystinger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants