Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Question about offset calculation #455

Closed
FrankMerema opened this issue Feb 19, 2019 · 1 comment · Fixed by #456
Closed

Question about offset calculation #455

FrankMerema opened this issue Feb 19, 2019 · 1 comment · Fixed by #456

Comments

@FrankMerema
Copy link
Contributor

FrankMerema commented Feb 19, 2019

Hi,

First of all great library! It's saving me a lot of work :D

I a question regarding scrolling within a <section> which is a scrollable container. (overflow: auto)
In this section I have some content which needs to have a sticky header which stays within the boundings of its scrollable parent.

On Chrome and FF this is working perfectly because of the css position: sticky, IE is not working as expected and thats why I came here.

But I noticed some weird behavior if the position fixed is used (on IE or in chrome by using the prop useFixed: true).

My questions are:
Q1: On line 240 I see you are subtracting the offset from the start, in my case it made the it.stickyStart a minus number. So I removed the subtraction and everything worked fine. So can we remove this subtraction or do I miss an important case? (tests are passing if I remove this subtraction)

Q2: On line 333 I see you are using the stickyBitOffset passed into the props (or 0 if none provided), but this is also miscalculating the offset if you are using it inside a scrollable section. My suggestions would be to use the it.offset which is calculated at line 239. This offset is consisting of the scrollElOffset plus the offset passed in via the props.

Maybe this is related to #327.

Thanks in advance!

@FrankMerema
Copy link
Contributor Author

FrankMerema commented Feb 19, 2019

I have made a branch in my fork but it is based on my typescript branch, which I also needed for testing in my Angular application.

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

Successfully merging a pull request may close this issue.

1 participant