With 2 months shown and inline calendar, the months shift when range selected spans the 2 months
See original GitHub issueI have an inline calendar with 2 months shown. Whenever a user selects a date range that spans the 2 months, if the range is not in the same month, the left month slides out of view. As seen in the gif below, In order to view the full range, a user must select the back arrow to see the range again.
Here is my code
<DatePicker
inline
selected={this.state.startDate}
startDate={this.state.startDate}
endDate={this.state.endDate}
onChange={this.handleDateSelect}
monthsShown={2}
shouldCloseOnSelect={false}
/>
I feel as if there should be a prop to enable / disable this.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Date Range Picker — JavaScript Date & Time Picker Library
A JavaScript component for choosing date ranges, dates and times. ... the two calendars displayed will always be for two sequential months (i.e....
Read more ><input type="month"> - HTML: HyperText Markup Language
A string representing the value of the month and year entered into the input, in the form YYYY-MM (four or more digit year,...
Read more >Calendar Multi month view Example | Mobiscroll
JQuery multi-month calendar. Always or dynamically show one, two or three months side by side depending on screen size.
Read more >React Datepicker crafted by HackerOne
A simple and reusable datepicker component for React.
Read more >Date picker - Shopify Polaris
The selected date or range of dates. monthnumber. The month to show, from 0 to 11. 0 is January, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t think the months were intended to shift when selecting a day. It seems like a buggy interaction between
monthsShown
andinline
. (Normally, the date picker would close after selecting a date, so re-opening to the last selected date is fine/expected, but staying open and shifting is weird.)@BeKnowDo this is actually fixed with
focusSelectedMonth={false}
. See gif.