[Bug]: Date Picker calls onChange twice #14465
Labels
adopter: strategic-product
Work-stream that directly effects the Product-led Growth initiative.
component: date-picker
role: dev 🤖
severity: 3
https://ibm.biz/carbon-severity
type: bug 🐛
Package
@carbon/react
Browser
Chrome
Package version
1.36.0
React version
18.2.0 (In Stackblitz. We're actually still on 16)
Description
onChange is called both when clicking a date in the calendar and again in onBlur.
Reproduction/example
https://stackblitz.com/edit/github-y8nl8z
Steps to reproduce
Click on the calendar icon in a DatePicker field and select a date. See the onChange console message printed. Click off the DatePicker such that it loses focus. See that the onChange is called again.
This is a problem because a xhr request is launched with the onChange so it's happening twice.
Suggested Severity
Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.
Application/PAL
OpenPages
Code of Conduct
The text was updated successfully, but these errors were encountered: