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

fix (horizontal scroll) in goTo #6915

Closed
wants to merge 1 commit into from
Closed

Conversation

raybog
Copy link

@raybog raybog commented Apr 4, 2019

Description

Horizontal scroll fix for goTo

Motivation and Context

fixes #6914

How Has This Been Tested?

Tested on latest Safari/Chrome/FF both iOS and macOS

Markup:

// n/a

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any feature but make things better)

Checklist:

  • [x ] The PR title is no longer than 64 characters.
  • [ x] The PR is submitted to the correct branch (master for bug fixes and documentation updates, dev for new features and breaking changes).
  • [ x] My code follows the code style of this project.
  • I've added relevant changes to the documentation (applies to new features and breaking changes in core library)

@codecov
Copy link

codecov bot commented Apr 4, 2019

Codecov Report

Merging #6915 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6915   +/-   ##
=======================================
  Coverage   85.31%   85.31%           
=======================================
  Files         298      298           
  Lines        7210     7210           
  Branches     1802     1802           
=======================================
  Hits         6151     6151           
  Misses        958      958           
  Partials      101      101
Impacted Files Coverage Δ
...kages/vuetify/src/components/Vuetify/goTo/index.ts 65.38% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a75024...2023717. Read the comment docs.

@@ -50,7 +50,7 @@ export default function goTo (_target: GoToTarget, _settings: Partial<GoToSettin

container.scrollTop = Math.floor(startLocation + (targetLocation - startLocation) * ease(progress))

if (progress === 1 || container.clientHeight + container.scrollTop === container.scrollHeight) {
if (progress === 1 || window.innerHeight + container.scrollTop === container.scrollHeight) {
Copy link
Member

Choose a reason for hiding this comment

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

does it still work if you use the container?

Copy link
Author

Choose a reason for hiding this comment

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

With container (container.clientHeight) works fine in Chrome and FF on macOS but not iOS.
Safari is impacted on both macOS and iOS.

With proposed change (window.innerHeight) works fine on all 3 browsers in macOs and iOS.

Copy link
Member

@jacekkarczmarczyk jacekkarczmarczyk Apr 4, 2019

Choose a reason for hiding this comment

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

I mean goTo(target, { container: ..., ...})

Copy link
Author

Choose a reason for hiding this comment

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

...sorry
when you pass container via goTo then inside thecontainer.scrollTop is always 0 (it is read only?)

Copy link
Author

Choose a reason for hiding this comment

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

Just had another look and perhaps even better solution to this problem (covering both scroll down and up) will be to change following:

if (progress === 1 || container.clientHeight + container.scrollTop === container.scrollHeight)
into
if (progress === 1 ) - tested and works well.

However not sure what is the purpose of container.clientHeight + container.scrollTop === container.scrollHeight ?

Copy link
Member

Choose a reason for hiding this comment

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

It stops the animation when scroll goes beyond the maximum value (for example you have small container but you want to do goTo(aBigNmber))

Copy link
Author

Choose a reason for hiding this comment

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

oh then perhaps this maximum value should be checked and adjusted before requestAnimationFrame is called?

Copy link
Member

Choose a reason for hiding this comment

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

Yea let's do that.

Copy link
Author

Choose a reason for hiding this comment

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

do you want me to create another pr where maximum value should be checked and adjusted before requestAnimationFrame is called?

@johnleider johnleider added the pending review The issue is still pending disposition label Apr 6, 2019
@johnleider johnleider requested a review from hymair April 29, 2019 12:28
@johnleider
Copy link
Member

This Pull Request is being closed due to inactivity.

Thank you for your contribution and interest in improving Vuetify!

@johnleider johnleider closed this May 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pending review The issue is still pending disposition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] goTo vertical scroll does not work on iOS
3 participants