Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

If on trackpad, don't mess with horizontal scrolling. #3148

Merged
merged 5 commits into from
Jun 28, 2019

Conversation

ara4n
Copy link
Member

@ara4n ara4n commented Jun 26, 2019

The trackpad heuristic is 'if 15 minutes of no horizontal scrollwheel events, assume user may have switched to mousewheel'

ara4n added 2 commits June 26, 2019 18:38
trackpad heuristic is 'if 15 minutes of no horizontal scrollwheel events, assume user may have switched to mousewheel'
@ara4n ara4n requested a review from turt2live June 26, 2019 17:39
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

otherwise lgtm, I think. Feels a bit more complicated than it needs to be, but it does appear to do things.

@@ -152,7 +164,7 @@ export default class IndicatorScrollbar extends React.Component {
const additionalScroll = e.deltaY < 0 ? -50 : 50;

// noinspection JSSuspiciousNameCombination
const val = Math.abs(e.deltaY) < 25 && safeToBoost ? (e.deltaY + additionalScroll) : e.deltaY;
const val = Math.abs(e.deltaY) < 25 ? (e.deltaY + additionalScroll) : 0;
Copy link
Member

Choose a reason for hiding this comment

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

this breaks vertical scrolling for non-smoothscrolling browsers (ie: windows)

Copy link
Member Author

Choose a reason for hiding this comment

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

yup, this was a thinko; suggestions welcome

Copy link
Member

Choose a reason for hiding this comment

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

instead of zero, e.deltaY, like it was before

this._checkAgainForTrackpad = now + (15 * 60 * 1000); // 15min
}
else {
// if we haven't seen any horizontal scrolling for >15 minutes, assume
Copy link
Member

Choose a reason for hiding this comment

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

we should bump this down to a minute if we're not sampling.

Copy link
Member Author

Choose a reason for hiding this comment

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

sgtm

src/components/structures/IndicatorScrollbar.js Outdated Show resolved Hide resolved
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

lgtm, although the linter is angry. I think both linting problems would be solved by putting the else with one line higher with the closing brace.

@jryans
Copy link
Collaborator

jryans commented Jun 28, 2019

I am assuming @ara4n wants this to land but is busy with other things, so merging.

@jryans jryans merged commit 2d13256 into develop Jun 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants