-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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]: Select component ignores "selected" property on page load #18164
Comments
Hi @thekevinhunt did you try setting the
On page load i see the select now starting with "Option 2" |
@ariellalgilmore ugh, I missed that value setting completely... but to my credit, that's not intuitive at all when you're used to the normal HTML select, and the misdirect of the documentation listing a "selected" setting for cds-select-item, combined with the "value" setting not being documented very clearly. It's working like I expect, knowing this now. If nothing else, I suggest removing the "selected" setting documentation since it apparently doesn't do anything, and making the "value" setting documentation not that it's aligned with what people would expect "selected" to do. |
Thanks for the feedback! Will reference this, so it gets updated in the parity issue #17931 |
@ariellalgilmore I agree with @thekevinhunt because, from the HTML perspective, our intuition would be to use the
|
Package
@carbon/web-components
Browser
Chrome
Package version
v2.18.0
React version
No response
Description
When using the cds-select component and including "selected" on a cds-select-item element, the option is not selected on page load. Interestingly, if you modify the DOM in the developer toolbar to add "selected" AFTER the page initially loads, it properly selects the element.
Interestingly, the "disabled" property doesn't have the same problem on cds-select-item elements.
Reproduction/example
https://stackblitz.com/github/carbon-design-system/carbon/tree/main/packages/web-components/examples/components/select?file=index.html
Steps to reproduce
Suggested Severity
Severity 2 = User cannot complete task, and/or no workaround within the user experience of a given component.
Application/PAL
IBM Industry Compliance PIMS Portal
Code of Conduct
The text was updated successfully, but these errors were encountered: