-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Sticky panel: add event listener for resizing to update measurements. #396
Conversation
Also removes sticky state when mobile viewport is detected, otherwise components like EditorGroundControl could get stuck in an incorrect state. (Obscuring the UI.)
Haven't reviewed the code, but this fixes the issue I experienced! Nice work! 👍 |
updateIsSticky: function() { | ||
var isSticky = window.pageYOffset > this.threshold; | ||
|
||
if ( viewport.isMobile() ) { | ||
return; | ||
return this.setState( { isSticky: false } ); |
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.
Do we need to set the state if the stickiness didn’t change?
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 could definitely include a this.state.isSticky
check in the if
.
362d979
to
65f0c84
Compare
65f0c84
to
73029cc
Compare
Thanks for the feedback. We can keep tweaking it after it's in, but it's nice to get something basic there to prevent the main issue of "hidden All Posts link". |
Sticky panel: add event listener for resizing to update measurements.
Also removes sticky state when mobile viewport is detected, otherwise components like EditorGroundControl could get stuck in an incorrect state. (Obscuring the UI.)
Testing
isMobile
checks), then scroll up in mobile view, then resize back to regular window size.@jasmussen do you mind taking a look at this?