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]: Controlled Combobox retaining old value in certain cases when we modify selected value #18158

Open
1 of 2 tasks
rajat-ninawe-pnipl opened this issue Nov 26, 2024 · 1 comment

Comments

@rajat-ninawe-pnipl
Copy link

Package

@carbon/react

Browser

No response

Package version

1.70.0

React version

18.20.2

Description

While using full controlled Combobox, while modifying value by external factors (by button in stackblitz example) or choosing option from dropdown, in some cases, it retains initial/old value it had.
Image

Reproduction/example

https://stackblitz.com/edit/github-fi6txq-8c4bw8?file=src%2FApp.jsx

Steps to reproduce

For above image, steps to reporduce:

  1. Click on Option 2 button
  2. From dropdown, select Option 1
  3. Clear the dropdown from clear(cross) icon in dropdown
  4. observe the console value. First it shows null but immediately then shows {id: 'option-1', text: 'Option 1'} as selected item. The dropdown is empty and also validation does not triggers.

Also, doing some random operations, more issues can be observed.

Suggested Severity

Severity 2 = User cannot complete task, and/or no workaround within the user experience of a given component.

Application/PAL

No response

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🕵️‍♀️ Triage
Development

No branches or pull requests

2 participants