-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@@ -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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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: ..., ...})
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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)
)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
This Pull Request is being closed due to inactivity. Thank you for your contribution and interest in improving Vuetify! |
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:
Types of changes
Checklist:
master
for bug fixes and documentation updates,dev
for new features and breaking changes).