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

[DateInput] Today's date looks like it's selected but is in fact not #1246

Closed
marwahaha opened this issue Jun 16, 2017 · 5 comments
Closed

Comments

@marwahaha
Copy link

Bug report

  • Package version(s): 1.20.0
  • Browser and OS versions: Chrome 58.0.3029.110

Steps to reproduce

  1. Go to http://blueprintjs.com/docs/#datetime/dateinput
  2. Set precision to something (not None)
  3. Click on input and remove date
  4. Click away and click again on (empty input)

Actual behavior

  1. Today's date is "selected" on the calendar

Expected behavior

  1. Today's date is not "selected" on the calendar.

You can contrast this with skipping step 2, and seeing no bug.
dateinput

@llorca
Copy link
Contributor

llorca commented Jun 16, 2017

Uh oh, good catch. Will look at it next week, hopefully it's a quick fix

@llorca llorca modified the milestones: 1.21.0, 1.22.0 Jun 23, 2017
@cmslewis cmslewis self-assigned this Jun 29, 2017
@cmslewis
Copy link
Contributor

Update: after investigating, looks like this.state.value is being updated properly on deselect, but this.state.valueString is not. On it.

@marwahaha
Copy link
Author

Hi @cmslewis @llorca , I tried my reproduction steps on the Blueprint website and it still wasn't working. Can you re-open this?

@cmslewis cmslewis reopened this Jul 12, 2017
@cmslewis
Copy link
Contributor

Yep, looks like it reselects today's date when the popover is reopened. Dang.

@lintardec
Copy link

Hi @cmslewis @llorca,

I'm seeing the same issue in the DateTimePicker component

blueprintjs/datetime package : 2.0.3

when my props.value is undefined the current date is selected

<DateTimePicker
value={isUndefined(props.value) ? undefined : props.formattedStringToDate(props.value)}
onChange={(selectedDate: Date, isUserChange: boolean) =>
props.updateQueryData(props.name, props.dateToFormattedString(selectedDate))}
/>
unlike using DatePicker
<DatePicker
value={isUndefined(props.value) ? undefined : props.formattedStringToDate(props.value)}
onChange={(selectedDate: Date, isUserChange: boolean) =>
props.updateQueryData(props.name, props.dateToFormattedString(selectedDate))}
/>

should this be raised as a new bug?

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

No branches or pull requests

4 participants