-
Notifications
You must be signed in to change notification settings - Fork 97
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(date-textbox): ensure correct date range order #2166
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: b75e9bd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
262856a
to
35c7001
Compare
35c7001
to
b75e9bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a bad bug with this.
If there's a date selected in both inputs and I type in a date after the second one then they swap. I think that creates a bad UX.
My feeling in that case is that the second date should probably clear rather than swap.
This case that we are trying to fix should only be applied when I use the calendar popover thingy.
"@ebay/ebayui-core": patch | ||
--- | ||
|
||
Order preservation fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we name this to be date-textbox: order preservation fix
const valueDate = new Date(value); | ||
const iso = isNaN(valueDate.getTime()) ? null : dateArgToISO(valueDate); | ||
if (index === 0) { | ||
this.state.firstSelected = iso; | ||
if (this.state.secondSelected && iso > this.state.secondSelected) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there can be a cleaner way to do this.
Lets first fix the issue with the date being swapped when typing manually. And then I will revisit this.
Blocking issue for now until we get more feedback on how to approach this. |
Description