As of 4.1.0 - <SingleDatePicker> only displays when the window is resized. The 'left' property is incorrectly set.
See original GitHub issueFirst, just want to say thank you to all the contributors of this great library. It’s been a pleasure to work with. The examples are great too.
Issue Summary
I’ve got a <SingleDatePicker>
like this:
<SingleDatePicker
id="changeUntil"
focused
placeHolder="MM/DD/YYYY"
date={this.state.until}
numberOfMonths={2}
isDayBlocked={d => d.isAfter(moment().add(5, 'year'))}
onDateChange={s => this.setState({
// end things at last moment of
// the end date chosen
until: s.endOf('day'),
count: null,
untilModal: false,
currentlyChoosing: null,
})}
orientation="vertical"
/>
It is mounted in a modal which opens - and when the modal closes it unmounts its children. The issue is that under this configuration the <SingleDatePicker>
has the wrong left style attribute until the window is resized. This happens for orientation vertical or horizontal.
Issue Proof (video)
My Current Solution
In my app stylesheet I simply added:
.SingleDatePicker__picker--direction-left {
left: 0!important;
}
Which fixes it. Fortunately !important
overrides the inline style applied by the library.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:5
Top Results From Across the Web
<SingleDatePicker> only displays when the window is resized ...
As of 4.1.0 - <SingleDatePicker> only displays when the window is resized. The 'left' property is incorrectly set. #207.
Read more >Change how a date or time is displayed in a date picker, text ...
Double-click the date picker, text box, or expression box control whose data you want to format. In the Control Properties dialog box, do...
Read more >Releases | Adjust Atlas
Prevent HeaderMenu opening when resizing column in Table component. (Ticket ATLAS-444). ... Fixed tooltip position when window size is small in ComboBox.
Read more >Ext.picker.Date | Ext JS 6.2.0 - Sencha Documentation
Summary. A date picker. This class is used by the Ext.form.field.Date field to allow browsing and selection of valid dates in a popup...
Read more >react-dates | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn. ≡. Home · Getting started.
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 FreeTop 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
Top GitHub Comments
I would like to add that I’m seeing a similar issue but for the
DateRangePicker
. It is in a modal that transitions its positioning and mounts while in the “before transition” position. As a result, theDateRangePicker
position is incorrect asresponsivizePickerPosition()
doesn’t get called again until the window is resized. I’m also using theleft: 0px !important
workaround.@majapw Sorry for the delay, my fix above works so well I totally forgot about this issue. Here’s a video showing the same behavior in horizontal mode without my css fix.