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

Ability to pass a custom function for computeScrollPosition #2402

Closed
preetmishra opened this issue Nov 13, 2024 · 2 comments
Closed

Ability to pass a custom function for computeScrollPosition #2402

preetmishra opened this issue Nov 13, 2024 · 2 comments

Comments

@preetmishra
Copy link

preetmishra commented Nov 13, 2024

What problem is this solving

Due to the way our HTML layout is set up, the scrollbar appears on an element several levels deeper rather than on the window itself, breaking the intended functionality. The scroll position is never restored because of the incorrect values in the savedPosition property.

export const computeScrollPosition = (): _ScrollPositionNormalized => ({
  left: window.scrollX,
  top: window.scrollY,
})

Proposed solution

We’d like the option to pass a custom function that calculates the top value based on another element's scrollTop in the HTML. We're open to other workarounds and are happy to submit a PR with the proposed solution as well.

Describe alternatives you've considered

No response

@posva
Copy link
Member

posva commented Nov 13, 2024

Closing in favor of #2403 which was in the board but not visible in issues

@posva posva closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2024
@preetmishra
Copy link
Author

Thanks, @posva! Any general timeline about how much time it could take? Happy to submit a PR too!

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

No branches or pull requests

2 participants