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(useScroll): support setting scroll position and toggling smooth scrolling #1996

Merged
merged 2 commits into from Sep 26, 2022
Merged

feat(useScroll): support setting scroll position and toggling smooth scrolling #1996

merged 2 commits into from Sep 26, 2022

Conversation

curtgrimes
Copy link
Contributor

@curtgrimes curtgrimes commented Jul 26, 2022

Description

feat(useScroll): support setting scroll position and toggling smooth scrolling

Add ability to set scroll values and turn on or off smooth scrolling.

fix #1978

Demo

use-scroll-2.mov

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.

wheatjs
wheatjs previously approved these changes Jul 29, 2022
Copy link
Member

@wheatjs wheatjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@curtgrimes
Copy link
Contributor Author

curtgrimes commented Jul 30, 2022

I added f38444e to fix this issue when scrolling the demo. (This was happening before the other changes introduced in this PR if you changed the zoom level of the webpage.) no longer relevant, see #1996 (comment)

Screen Recording 2022-07-30 at 2 17 38 PM

@wheatjs
Copy link
Member

wheatjs commented Jul 31, 2022

@curtgrimes maybe it would be better to implement this into useScroll as we might want to deprecate useWindowScroll in favor of useScroll

@curtgrimes
Copy link
Contributor Author

@wheatjs Ok, should useWindowScroll() be formally deprecated if we don't want to add new features to it? Is there documentation written somewhere where I can see which composables are being considered for deprecation so I do not look at improving those?

I can look at moving this functionality into useScroll() instead if useWindowScroll() should be formally deprecated.

@wheatjs
Copy link
Member

wheatjs commented Aug 1, 2022

@wheatjs Ok, should useWindowScroll() be formally deprecated if we don't want to add new features to it? Is there documentation written somewhere where I can see which composables are being considered for deprecation so I do not look at improving those?

I can look at moving this functionality into useScroll() instead if useWindowScroll() should be formally deprecated.

Anthony and I briefly discussed it a couple days ago. Most functions are unlikely to be deprecated, we are only thinking about this one since it duplicates functionality

@curtgrimes
Copy link
Contributor Author

Thanks. I'll migrate these changes over to useScroll.

@curtgrimes curtgrimes marked this pull request as draft August 1, 2022 13:21
@curtgrimes curtgrimes changed the title feat(useWindowScroll): support setting scroll position and toggling smooth scrolling feat(useScroll): support setting scroll position and toggling smooth scrolling Aug 5, 2022
@curtgrimes curtgrimes marked this pull request as ready for review August 5, 2022 06:31
@curtgrimes
Copy link
Contributor Author

I have moved this functionality from useWindowScroll to useScroll.

…scrolling

Add ability to set scroll values and turn on or off smooth scrolling.

fix #1978
wheatjs
wheatjs previously approved these changes Aug 5, 2022
@curtgrimes
Copy link
Contributor Author

Resolved merge conflict.

@curtgrimes
Copy link
Contributor Author

@antfu @wheatjs Please let me know if there's anything you need from me to push this forward. Thanks!

@sxzz sxzz requested review from wheatjs and antfu September 25, 2022 07:48
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.

useWindowScroll is read only
4 participants