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]: Select component ignores "selected" property on page load #18164

Open
2 tasks done
thekevinhunt opened this issue Nov 26, 2024 · 0 comments
Open
2 tasks done

[Bug]: Select component ignores "selected" property on page load #18164

thekevinhunt opened this issue Nov 26, 2024 · 0 comments

Comments

@thekevinhunt
Copy link

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

  1. Use the existing stackblitz build provided in the docs (https://web-components.carbondesignsystem.com/?path=/docs/components-select--overview)
  2. Simply add "selected" as a property to any cds-select-item in the index.html file.
  3. The page will automatically reload, but the option won't be selected
  4. Edit the live HTML directly in the web developer tools and the option will get selected fine

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants