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: onChange calls reduced to 1 when interacting with keyboard #18435

Merged
merged 6 commits into from
Feb 4, 2025

Conversation

Gururajj77
Copy link
Contributor

Closes #18386

Fixed the onChange from getting fired twice.

Changelog

New

  • added the condition highlightedIndex === -1 to make sure the onChange fires only if the inputValue does not match with any of the items.

Changed

  • modified a test's state updation for better checking.

Testing / Reviewing

  • check the test story and interact with the keyboard
  • check the console and see it does not have 2 console logs when we select items once.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link

netlify bot commented Jan 27, 2025

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

Name Link
🔨 Latest commit 84ea298
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-web-components/deploys/67a1c4fb4d68620008e8fb82
😎 Deploy Preview https://deploy-preview-18435--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 84ea298
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/67a1c4fb54550a00089d2d7a
😎 Deploy Preview https://deploy-preview-18435--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

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.13%. Comparing base (facb207) to head (84ea298).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #18435   +/-   ##
=======================================
  Coverage   84.13%   84.13%           
=======================================
  Files         408      408           
  Lines       14456    14460    +4     
  Branches     4703     4703           
=======================================
+ Hits        12162    12166    +4     
- Misses       2128     2129    +1     
+ Partials      166      165    -1     

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

Gururajj77 and others added 2 commits January 27, 2025 20:12
Copy link

netlify bot commented Jan 27, 2025

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit 6b4a68e
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/67979b4713193f0007e7c725
😎 Deploy Preview https://deploy-preview-18435--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

netlify bot commented Jan 27, 2025

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit 84ea298
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/67a1c4fb4b74eb00085f2d6b
😎 Deploy Preview https://deploy-preview-18435--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.

@Gururajj77 Gururajj77 marked this pull request as ready for review January 28, 2025 06:42
@Gururajj77 Gururajj77 requested a review from a team as a code owner January 28, 2025 06:42
@Gururajj77 Gururajj77 requested review from emyarod and guidari January 28, 2025 06:42
Copy link
Contributor

@preetibansalui preetibansalui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Contributor

@guidari guidari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as expected! LGTM 🚀
It just have to remove the test stories before merging

@Gururajj77 Gururajj77 added this pull request to the merge queue Jan 29, 2025
@guidari guidari removed this pull request from the merge queue due to a manual request Jan 29, 2025
Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@guidari
Copy link
Contributor

guidari commented Jan 30, 2025

@Gururajj77 It just have to remove the test stories

@Gururajj77 Gururajj77 enabled auto-merge February 4, 2025 07:42
@Gururajj77 Gururajj77 added this pull request to the merge queue Feb 4, 2025
Merged via the queue into main with commit 856a70a Feb 4, 2025
37 checks passed
@Gururajj77 Gururajj77 deleted the combobox-check branch February 4, 2025 08:26
Copy link
Contributor

github-actions bot commented Feb 4, 2025

The content of this pull request will be made available as part of our next release. For the full schedule of upcoming releases, check out our Release Radar page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Combobox triggering onChange with previous value before updating the user selected value
4 participants