Skip to content
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

With very tall page and sidebar there is just a jump at halfway #11

Closed
wzol opened this issue May 18, 2021 · 15 comments · Fixed by #14
Closed

With very tall page and sidebar there is just a jump at halfway #11

wzol opened this issue May 18, 2021 · 15 comments · Fixed by #14

Comments

@wzol
Copy link

wzol commented May 18, 2021

Here is a sample: https://jsfiddle.net/71zwtoLu/

If you scroll downwards, almost at half of the page, you will see that the "TOP LINES" part of the sidebar will jump into view. It works fine with smaller items.

Is this a limitation, is there a workaround for this?

@wzol wzol changed the title With very high page and sidebar there is just a jump at halfway With very tall page and sidebar there is just a jump at halfway May 18, 2021
@vursen
Copy link
Owner

vursen commented May 19, 2021

Hello @wzol,

Could you provide a video where I could see the problem?

I tried to reproduce your issue, but the "TOP LINES" text remains at the top of the page when scrolling that appears to be an expected behavior.

@wzol
Copy link
Author

wzol commented May 19, 2021

Here, after 17 seconds: https://imgur.com/a/2AzSj6U

@vursen
Copy link
Owner

vursen commented May 19, 2021

@wzol Thanks! Which browser do you use?

@wzol
Copy link
Author

wzol commented May 19, 2021

Edge 92.0.892.0

@vursen
Copy link
Owner

vursen commented May 19, 2021

@wzol Interesting... I didn't use to see this issue before, but I assume this is something specific to Edge.

Did you have a chance to see if it works in other browsers and other Edge versions?

@wzol
Copy link
Author

wzol commented May 19, 2021

Strange, seems to work fine in Edge 90.0.818.62 - Edge has smoother scrolling, but shouldn't have this kind of effect. It also seems to work in Chrome 92.0.4512.1

@vursen
Copy link
Owner

vursen commented May 22, 2021

I looked over the transitions and presumably there are two places where the problem could come from.

So, it is either the viewport height is calculated incorrectly at some point:

https://github.com/vursen/FloatSidebar.js/blob/master/src/fsm-transitions.js#L23

...or the same with the path height:

https://github.com/vursen/FloatSidebar.js/blob/master/src/fsm-transitions.js#L24

I'm inclined to think it is most likely something wrong happens with the viewport height..., but I don't have Edge on deck to debug.

I would appreciate if you could debug this case in your Edge version. And to do that, you need to add logging dimensions over here:

https://github.com/vursen/FloatSidebar.js/blob/master/src/fsm-actions.js#L11

[states.TOP_FIXED]: (d, { $sideInner }) => {
  console.log(d); // <!-------------- Here
  
  $sideInner.style.position = 'fixed';
  $sideInner.style.top      = `${d.topSpacing}px`;
  $sideInner.style.bottom   = 'auto';
},

Please, let me know what the dimensions are logged when the plugin enters the TOP_FIXED state.

@wzol
Copy link
Author

wzol commented May 24, 2021

Sure, I try to help - can I somehow do this with the fiddle above?

@vursen
Copy link
Owner

vursen commented Oct 14, 2021

I'm sorry for the late response. Is the issue still actual? Does the issue occur in the latest Edge version?

@wzol
Copy link
Author

wzol commented Oct 14, 2021

Tried the jsfiddle with Edge 96.0.1044.0 - it still occurs.

@vursen
Copy link
Owner

vursen commented Nov 14, 2021

I've just released a new version where I added basic unit tests and also fixed some bugs revealed by the added tests along the way.

Please, update the library to v1.2.4 and comment if the issue still occurs for you.

@datio
Copy link

datio commented Nov 25, 2021

We have a similar issue on our website using the previous version (first example in the video).
When scrolling back to the top, on specific heights, the contents are positioned incorrectly.

The newer version (last example in the video) brings the content to the correct position when the page is scrolled back to the top, but jumps a lot more.

[just removed the link as it's 404]

@vursen
Copy link
Owner

vursen commented Nov 25, 2021

I managed to reproduce both issues and I'll come with a fix on the weekend.

@vursen
Copy link
Owner

vursen commented Nov 28, 2021

The issue seems to be fixed. Please, update the library to v1.2.5 and comment if the issue has not been resolved for you.

@wzol
Copy link
Author

wzol commented Nov 29, 2021

Cool, thank you! :) Here is a new fiddle for others to test ;) https://jsfiddle.net/Lg769zao/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants