React-dates: DateRangePicker blinking after select startDate

Created on 1 Feb 2019  ·  15Comments  ·  Source: airbnb/react-dates

Hello, there.
I'm setting up DateRangePicker, but when I select startDate the calendar blinks.

screencast-localhost-3000-2019 02 01-11-33-13

Here's my code

<DateRangePicker
        startDate={this.state.startDate} 
        startDateId="startDate" 
        endDate={this.state.endDate} 
        endDateId="endDate" 
        onDatesChange={({ startDate, endDate }) => this.setState({startDate, endDate})}
        focusedInput={this.state.focusedInput}
        onFocusChange={focusedInput => this.setState({focusedInput})} 
      />
bug pull request wanted

Most helpful comment

In case it helps track down the cause of this issue: if you select a start date that isn't within the leftmost month, the calendar re-renders to show that month on the far left. This doesn't happen pre-18.3.1.

EDIT: In fact, every version up to and including 18.4.0 works as expected

ohdear

All 15 comments

I have the same issue.

@thais-molica After further investigation, I found that version 18.3.1 doesn't have this blinking bug. Maybe that works for you for now. I know I'm sticking to that version for the mean time.

I'm having the same issue, anybody knows something about this issue?

Thanks @fillipe-ramos for the tip, that version works perfectly for me.

I'm looking into this.

In case it helps track down the cause of this issue: if you select a start date that isn't within the leftmost month, the calendar re-renders to show that month on the far left. This doesn't happen pre-18.3.1.

EDIT: In fact, every version up to and including 18.4.0 works as expected

ohdear

Looks like this is something to do with the change of focus between the start date and end date inputs, which happens to be triggered when you select a date. If you simply select the end date input box directly, the same flashing occurs. This doesn't happen in 18.4.0.

Any updates? It's failing on line max length check.

@mmakarin over by 1 character 🤦‍♂️ just fixed in a new commit, should be fine now!

Any updates?

Still blinking on 20.2.5

@GfxKai @ljharb Why this issue is still tagged as pull request wanted and why #1553 is still doesn't merged?

Edit: I merged PR to latest master in #1734 if this is a blocker for merging.

@EugeneDraitsev please do not open duplicate PRs; it’s unnecessary (maintainers can update abandoned PRs directly) and it adds permanent garbage to the git log.

It’s waiting on https://github.com/airbnb/react-dates/pull/1553#issuecomment-499228353.

If you want to comment on the PR with a link to those changes, a maintainer can pull them in and do the rebase.

@ljharb Ok, I closed my PR. Will try to help with tests for SingleDatePickerInput.jsx and comment #1553 with link to changes

This is merged but doesn't seem to be released yet. Any updates on when this will be released?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

easwee picture easwee  ·  55Comments

AntiFish03 picture AntiFish03  ·  19Comments

brunocoelho picture brunocoelho  ·  28Comments

thinhdd88 picture thinhdd88  ·  22Comments

Jucesr picture Jucesr  ·  19Comments