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]: Date picker of type range never call onChange when second input value change #12980

Closed
2 tasks done
Tracked by #13510
wwwju opened this issue Jan 16, 2023 · 3 comments · Fixed by #13443
Closed
2 tasks done
Tracked by #13510

[Bug]: Date picker of type range never call onChange when second input value change #12980

wwwju opened this issue Jan 16, 2023 · 3 comments · Fixed by #13443

Comments

@wwwju
Copy link

wwwju commented Jan 16, 2023

Package

@carbon/react

Browser

Chrome

Package version

v1.11.0

React version

v17.0.2

Description

This bug is for the possibility to type a date by hand and not using the calendar widget.
For a range date picker, the onChange props is never called after typing in the second input (and not choosing a date in the calendar) and close the calendar.
It works for the first input. And of course it works normally by using the calendar widget for both input.

Suggested Severity

Severity 1 = Must be fixed ASAP. The response must be swift. Someone from the team must drop all current work and be immediately reassigned to address the issue.

Reproduction/example

https://stackblitz.com/edit/github-pzlus6-jt29yb?file=src/App.jsx

Steps to reproduce

  • Type a date in the first input, quit & focus again the first input, the date in the calendar change
  • Type a date in the second input, quit & focus again the second input, the date don't change on the calendar
  • try console.log the onChange prop, for the first input the function is called, for the second nothing happen.

Code of Conduct

@tw15egan tw15egan added component: date-picker severity: 3 https://ibm.biz/carbon-severity severity: 2 https://ibm.biz/carbon-severity and removed status: needs triage 🕵️‍♀️ severity: 3 https://ibm.biz/carbon-severity labels Jan 17, 2023
@tay1orjones tay1orjones added this to the 2023 Q1 milestone Jan 26, 2023
@tay1orjones tay1orjones self-assigned this Jan 26, 2023
@francinelucca
Copy link
Collaborator

@tay1orjones not closed by #13108 🥲, I think technically it would but there's a bug on top of this bug where the first date is getting deleted after doing step 1 and attempting step 2:

Screen.Recording.2023-02-09.at.12.19.09.PM.mov

@alisonjoseph
Copy link
Member

@tay1orjones @francinelucca I'm seeing this bug in the Flatpickr example here https://flatpickr.js.org/plugins/ is this something we can fix in Carbon, or is this an upstream bug? It seems that when you select the first date it expects you to select the second without clicking off of it. Perhaps not a bug, and just the way the component was intended to work?

@francinelucca
Copy link
Collaborator

Yeah I believe it's an upstream bug. These issues seem related:

I'd think it is a bug since the behavior seems very unexpected to me.
We could try and hack it if we wanted to, or wait for upstream to be fixed. Doesn't seem like there's much going on in the flatpickr repo tho' these days... Last published version is a year ago https://www.npmjs.com/package/flatpickr?activeTab=versions

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

Successfully merging a pull request may close this issue.

6 participants