-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Remove invokation of responsivizePickerPosition from componentDidMount #183
Remove invokation of responsivizePickerPosition from componentDidMount #183
Conversation
This is not the correct solution. Based on my comment #181 (comment), let's change the
|
@Ikana please rebase on the command line so any merge commits are excised. Thanks! |
I think I broke something the tests pass on my local repo. |
I think it has to do with the recent update of react, the error is:
And on the blog post for |
React 15.4 did break things; #184 will fix it. |
so it wasn't me 😅 |
Nope! rebase and you should be set. |
@@ -89,7 +89,6 @@ export default class SingleDatePicker extends React.Component { | |||
/* istanbul ignore next */ | |||
componentDidMount() { | |||
window.addEventListener('resize', this.responsivizePickerPosition); | |||
this.responsivizePickerPosition(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make the same change as you did in DateRangePicker
here?
Once you make the last change, can you squash all your commit into one and rebase on the latest master? |
Sure thing |
window.addEventListener('resize', this.responsivizePickerPosition); | ||
this.responsivizePickerPosition(); | ||
if (!withPortal && !withFullScreenPortal) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work on window resize still. Can you please update this file in the same way you did the DateRangePicker
(ie put this check inside of the responsivizePickerPosition
function instead of here)
@@ -1,5 +1,8 @@ | |||
# Change Log | |||
|
|||
## v4.0.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ikana please do a rebase on the latest master rather than clicking "update branch", which creates a merge commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am a little new to open source collaboration, do you know of a good tutorial on that, i thought i did it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Ikana! Basically in your terminal you can run the following steps:
git checkout master
git pull airbnb master
git checkout fix-get-client-bounding-rect
git rebase master
git push -f origin fix-get-client-bound-rect
If you don't have airbnb configured as a remote branch, you'll have to do:
git remote add airbnb [email protected]:airbnb/react-dates.git
window.addEventListener('resize', this.responsivizePickerPosition); | ||
this.responsivizePickerPosition(); | ||
if (!withPortal && !withFullScreenPortal) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this check here because we have it on line 293.
…ullScreenPortal are set to true When either portal option is set, the DayPicker is not rendered at all when hidden. What's more, it is centered on the screen and as a result does not need to be moved based on its location relative to the edge of the screen.
…r method in the SDP
@ljharb this should be good to go, can you do a last pass? |
Hey @majapw thanks a lot for the patience and the help with git |
No problem @Ikana! :D Thank you so much for the contribution. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
const containerRect = this.dayPickerContainer.getBoundingClientRect(); | ||
const currentOffset = dayPickerContainerStyles[anchorDirection] || 0; | ||
const containerEdge = | ||
isAnchoredLeft ? containerRect[ANCHOR_RIGHT] : containerRect[ANCHOR_LEFT]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this line be moved to the previous one, so there's no linebreak after an assignment operator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's too long, and I preferred having the ternary on one line rather than splitting after the ?
. Which do you think is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i always prefer a long line to arbitrary line breaks - ling length restrictions are always silly, and a poor proxy for readability.
const containerRect = this.dayPickerContainer.getBoundingClientRect(); | ||
const currentOffset = dayPickerContainerStyles[anchorDirection] || 0; | ||
const containerEdge = | ||
isAnchoredLeft ? containerRect[ANCHOR_RIGHT] : containerRect[ANCHOR_LEFT]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here
This addressed the issue #181 on the storyboard, but should the method responsivizePickerPosition be invoked from an other method?