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(datepicker): adds Optional chaining #18046

Merged
merged 5 commits into from
Nov 13, 2024
Merged

Conversation

2nikhiltom
Copy link
Contributor

Closes #17794

adds Optional chaining to fix Cannot read properties of undefined error

Changelog

Changed

Adds ?. operator before calling setHours and toString functions

Testing / Reviewing

Open the DatePicker component configured for a date range.
Select a start and end date.
Clear the entire input field for end date.
Move the focus to another input field (start date) or component
verify to errors in console

Uploading Screen Recording 2024-11-12 at 14.50.07.mov…

@2nikhiltom 2nikhiltom requested a review from a team as a code owner November 12, 2024 09:21
Copy link

netlify bot commented Nov 12, 2024

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

Name Link
🔨 Latest commit 081abef
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-web-components/deploys/67349a80d386df00081ff364
😎 Deploy Preview https://deploy-preview-18046--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 Nov 12, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit b036f77
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/67331e0a768063000807a360
😎 Deploy Preview https://deploy-preview-18046--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 Nov 12, 2024

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit b036f77
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/67331e0a0359370008da8b48
😎 Deploy Preview https://deploy-preview-18046--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 Nov 12, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 081abef
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/67349a8091ca790008e2493d
😎 Deploy Preview https://deploy-preview-18046--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 Nov 12, 2024

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit 081abef
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/67349a8081c972000878c41d
😎 Deploy Preview https://deploy-preview-18046--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 Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.15%. Comparing base (5cf7bff) to head (081abef).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18046      +/-   ##
==========================================
+ Coverage   82.10%   82.15%   +0.04%     
==========================================
  Files         404      404              
  Lines       14107    14107              
  Branches     4426     4426              
==========================================
+ Hits        11582    11589       +7     
+ Misses       2363     2356       -7     
  Partials      162      162              

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

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.

Hey Nikhil, It looks good to me. Could you please add a test case for this condition as well?

Copy link
Contributor

@riddhybansal riddhybansal 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 !! Thanks for adding test cases

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!

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.

Thanks for the test Nikhil

@2nikhiltom 2nikhiltom added this pull request to the merge queue Nov 13, 2024
Merged via the queue into main with commit 0ee6d40 Nov 13, 2024
40 checks passed
@2nikhiltom 2nikhiltom deleted the datepicker-bug-fix-17794 branch November 13, 2024 16:49
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Datepicker - Error Occurs When Clearing Dates in DatePicker Component of Carbon React
4 participants