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

Cancel list scroll reset after mouse move on wheel scroll #9233

Merged

Conversation

lmorchard
Copy link
Contributor

Also fixes an error introduced in #9200 caused by attempting to use an
undefined prop.

Fixes #9217

@lmorchard
Copy link
Contributor Author

I think this should fix #9217 - looked like the main issue was that I missed wheel scrolling as a source of intentional scrolling.

@lmorchard lmorchard force-pushed the 9217-prevent-scroll-reset-on-wheel branch from 46bfd84 to af1faa2 Compare November 8, 2018 03:34
@mayaeh
Copy link
Contributor

mayaeh commented Nov 8, 2018

In my environment, I seems that scrolling the timeline with the Firefox for mac (63.0.1) is heavier than before merging this PR's code.

Edit: I felt it improved as I restarted the browser. I'm sorry.

I seems that there is no problem with the Safari for mac (12.0.1) and the Chrome for mac (70.0.3538.77).

As for Windows, I can not test it until I return from work... sorry.

I will try it in another environment after I return from work.

@Gargron
Copy link
Member

Gargron commented Nov 8, 2018

I wonder if these things need to be in state if they are never rendered. Using simple variables might work better and improve performance.

@Gargron Gargron added the bug Something isn't working label Nov 8, 2018
@mayaeh
Copy link
Contributor

mayaeh commented Nov 8, 2018

I tried this on the Chrome for Windows (70.0.3538.77) and the Firefox for Windows (63.0.1).
I think that it was fixed within the range that I care about an issue.

@Gargron
Copy link
Member

Gargron commented Nov 8, 2018

What's the extent of this issue if you are manually scrolling with page up/down, the scrollbar, or arrow keys? (Because the fix seems to depend on the wheel event specifically)

@lmorchard lmorchard force-pushed the 9217-prevent-scroll-reset-on-wheel branch from af1faa2 to 9b8c1e7 Compare November 8, 2018 17:25
@lmorchard
Copy link
Contributor Author

lmorchard commented Nov 8, 2018

I wonder if these things need to be in state if they are never rendered

I'd put them in state because I figured I'd add some visual indication of the pause, but then figured it wasn't particularly necessary.

That can always be changed later, though, so I just amended the commit to move these into plain object properties. That simplifies the logic as a bonus.

- Use object properties rather than component state for
  mouseMovedRecently and scrollToTopOnMouseIdle flags

- Remove redundant scrollToTop prop call, also fixing an attempt to call
  an undefined prop.

Fixes mastodon#9217
@lmorchard lmorchard force-pushed the 9217-prevent-scroll-reset-on-wheel branch from 9b8c1e7 to 68b3112 Compare November 8, 2018 17:36
@lmorchard
Copy link
Contributor Author

And one more tweak, as I just realized my call to this.props.scrollToTop was redundant because the scroll event gets fired by setting node.scrollTop and handleScroll takes care of it anyway.

@Gargron Gargron merged commit 9cfd610 into mastodon:master Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Scratch" may occur when scrolling the timeline
3 participants