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

feat: add reactive window.scrollTo watcher to useWindowScroll #2394

Closed
wants to merge 1 commit into from
Closed

feat: add reactive window.scrollTo watcher to useWindowScroll #2394

wants to merge 1 commit into from

Conversation

Solant
Copy link

@Solant Solant commented Nov 2, 2022

Description

Add watcher with window.scrollTo callback for exported x and y refs, so anyone can make whole page scroll with already exported refs

Additional context

Currently, exported x, and y are simple writable refs, so I can write to them without any warning and with no side effect. It makes sense to either make them read-only (computed) or just add scrollTo function to handle window scroll on change

Things that are not covered in this PR:


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@webfansplz
Copy link
Member

See #1996 (comment)

@Solant
Copy link
Author

Solant commented Nov 4, 2022

@webfansplz thanks

Should I close this PR as it is duplicate/deprecated functionality (e.g. migration from useWindowScroll to useScroll), or I can update PR to call useScroll with window parent, to make things work seamlessly?

@webfansplz
Copy link
Member

@webfansplz thanks

Should I close this PR as it is duplicate/deprecated functionality (e.g. migration from useWindowScroll to useScroll), or I can update PR to call useScroll with window parent, to make things work seamlessly?

I think we can just close it, anyway, thanks for the PR.

@Solant Solant closed this Nov 5, 2022
@Solant Solant deleted the reactive-scroll branch November 7, 2022 22:32
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 this pull request may close these issues.

None yet

2 participants