SingleDatePicker misaligned
See original GitHub issueHi guys, thanks for maintaining this great lib.
I’m facing this UI issue though:
I don’t know why a left property is being applied to my calendar.
left: -292.984px;
And it looks like the z-index is not working even though it uses z-index:1
. My footer has position: absolute
too and z-index:0
;
I’m debugging it for quite a long time and I can’t see anything from my side interfering on the calendar.
I can workaround it applying left:0
to the calendar.
Maybe you guys have any thoughts?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
SingleDatePicker misaligned · Issue #248 - GitHub
I don't know why a left property is being applied to my calendar. ... And it looks like the z-index is not working...
Read more >Checkboxes on spreadsheet misaligned when sorting
Hi - I have a spreadsheet that's being populated from another sheet with data, checkboxes and date pickers. This is to enable tracking...
Read more >SingleDatePicker by react-dates is not closing on change
How about trying this? According to its document, onFocusChange seems to should take { focused : boolean } objects as parameters. const ...
Read more >Datepicker font control - Dash Python - Plotly Community Forum
DatepickerSingle and DatepickerRange are rendered with font size larger than Dropdown and Input. How to equalize these components font sizes?
Read more >react-dates example, react date range picker, react-dates ...
A flexible date picker component for React, with no dependencies, fully customizable, localizable and with ARIA support. react-dates singledatepicker example.
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
Hi @majapw I appreciate your attention, you don’t need to apologize, remote debugging is pretty hard.
a)
b) In order to fix the position and add some styling:
@brunocoelho That makes sense because what I expect the calculated style to be is
left: 0
with your particular set-up.Basically, on
componentDidMount
(and also whenever you resize the window), the inline styles that are applied get set here: https://github.com/airbnb/react-dates/blob/master/src/components/SingleDatePicker.jsx#L207:L212.This is somewhat obfuscated but basically this file (https://github.com/airbnb/react-dates/blob/master/src/utils/getResponsiveContainerStyles.js) ends up setting the
ANCHOR_DIRECTION
value (in this case,left
) of the picker based on the window width, and thethis.dayPickerContainer.getBoundingClientRect()
right
value. In your case, for whatever reason the client rect right value is … larger than the window width. This may have something to do with how you’re styling the input to fill the space.Can you share
(a) the value of
document.querySelector('.SingleDatePicker__picker').getBoundingClientRect()
(b) what styles you are applying to.DateRangePicker
(or anything else) to get it to fill the width of your container?Sorry for all the back and forth! I think we’re getting closer to a solution (and remote debugging is hard).