We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Docs say that ReactNode can be used as children, however, using anything other than a string breaks the layout.
There is a related community thread here: https://community.shopify.com/c/shopify-apps/polaris-components-combobox-listbox-option-cannot-use-react-node/m-p/2603736#M79181
You should be able to use any ReactNode as a Listbox.Option child. This will allow custom content in the listbox.
Adding custom children breaks the layout. If you try to add styled children, it somewhat works, but the accessibility / keyboard controls don't work.
Create a Listbox.Option with custom children:
<Listbox.Option key={`${variantId}`} value={variantId} selected={isSelected} accessibilityLabel={title} > <Box width="100%"> <Text as="p" variant="bodyXs"> {group} </Text> {title} </Box> </Listbox.Option>
See the layout is broken:
Yes
@shopify/[email protected]
Chrome
Macbook Pro
The text was updated successfully, but these errors were encountered:
Hello, I can work on this issue
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Summary
Docs say that ReactNode can be used as children, however, using anything other than a string breaks the layout.
There is a related community thread here:
https://community.shopify.com/c/shopify-apps/polaris-components-combobox-listbox-option-cannot-use-react-node/m-p/2603736#M79181
Expected behavior
You should be able to use any ReactNode as a Listbox.Option child. This will allow custom content in the listbox.
Actual behavior
Adding custom children breaks the layout. If you try to add styled children, it somewhat works, but the accessibility / keyboard controls don't work.
Steps to reproduce
Create a Listbox.Option with custom children:
See the layout is broken:
Are you using React components?
Yes
Polaris version number
@shopify/[email protected]
Browser
Chrome
Device
Macbook Pro
The text was updated successfully, but these errors were encountered: