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

fix: controlled combobox with downshiftProps #18441

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Neues
Copy link
Contributor

@Neues Neues commented Jan 27, 2025

Closes #18212

ensure onChange is called when downshiftProps & onStateChange is provided

Changelog

Changed

  • spread downshiftProps before defining onStateChange
  • call downshiftProps in onStateChange if it exists
  • unit test

testing

  • remove the args in the _fullyControlled example in ComboBox.stories.js (you need to do this to see console.logs for some reason)
  • add a console.log to the onChange here
  • add downshiftProps with onStateChange to the props of the ComboBox
    ie.
        downshiftProps={{
          onStateChange: () => console.log('onstatechange downshiftprops')
        }}
  • verify that both the function provided to onStateChange and the function provided to onChange are firing.

ensure onChange is called when downshiftProps & onStateChange is provided
Copy link

netlify bot commented Jan 27, 2025

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 1b95483
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-web-components/deploys/6798f4e9ebca4c00082da515
😎 Deploy Preview https://deploy-preview-18441--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 27, 2025

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 1b95483
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/6798f4e9090b650008ce26a7
😎 Deploy Preview https://deploy-preview-18441--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 27, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1b95483
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/6798f4e9bc683c0008b3f75b
😎 Deploy Preview https://deploy-preview-18441--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.16%. Comparing base (5a0348c) to head (1b95483).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #18441   +/-   ##
=======================================
  Coverage   84.16%   84.16%           
=======================================
  Files         408      408           
  Lines       14449    14450    +1     
  Branches     4696     4666   -30     
=======================================
+ Hits        12161    12162    +1     
+ Misses       2124     2123    -1     
- Partials      164      165    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Neues Neues marked this pull request as draft January 27, 2025 15:24
@Neues Neues marked this pull request as ready for review January 28, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: ComboBox downshiftProps after selecting a item is not emitting onChange event
1 participant