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 Chrome 55+ mobile & new pad sensitivity option #330

Closed
wants to merge 2 commits into from
Closed

Fix Chrome 55+ mobile & new pad sensitivity option #330

wants to merge 2 commits into from

Conversation

inuyaksa
Copy link

@inuyaksa inuyaksa commented May 8, 2017

- fixed Chrome 55+ mobile pich/touch flickering bug #303
- fixed Chrome passive event warning #328
- add new otion "pan sensitivity"
@jcnventura
Copy link
Contributor

I think you should have done this in 3 different PRs... Also, looking at the PR diff, in one place you're adding 3 lines of commented code, and a few lines below you're adding some trailing space.

@inuyaksa
Copy link
Author

Sorry, what do you mean about PRs?

Feel free to use my corrections for your project. I'm using since 2 month and it works well on all configurations desktop/mobile.

@jcnventura
Copy link
Contributor

PR -> Pull requests.. There's too many changes here, and they're not related.

Copy link
Contributor

@jcnventura jcnventura left a comment

Choose a reason for hiding this comment

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

Split these into different PRs, please.

@@ -1125,6 +1128,10 @@
if (this.panning) {
return;
}

var type = event.type;
if (window.PointerEvents&&(type === 'touchstart')) return false; // fix double events pointer/touch on Chrome >=55 #303
Copy link
Contributor

Choose a reason for hiding this comment

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

window.PointerEvents??? Is there such a thing? I think this is a typo. And you meant window.PointerEvent. See https://developers.google.com/web/updates/2016/10/pointer-events

@@ -310,6 +310,9 @@
// Pan only when the scale is greater than minScale
panOnlyWhenZoomed: false,

// Pan sensitivity, min pixels to start to panning
panSensitivity: 4,

Copy link
Contributor

Choose a reason for hiding this comment

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

New functionality move to a different PR.

var type = event.type;

// Indicate that we are currently panning
//this.panning = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Dead code.. Don't add stuff like this in a PR.


// Use proper events
if (type === 'pointerdown') {
moveEvent = 'pointermove';
endEvent = 'pointerup';
} else if (type === 'touchstart') {
moveEvent = 'touchmove';
endEvent = 'touchend';
endEvent = 'touchend';
Copy link
Contributor

Choose a reason for hiding this comment

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

Trailing whitespace.. This change should not be here.

@@ -1160,9 +1169,6 @@
// Remove any transitions happening
this.transition(true);

// Indicate that we are currently panning
this.panning = true;

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be because of the new Pan sensitivity functionality.. Move to a different PR, please.

if ((Math.abs(coords.pageX-startPageX)<self.options.panSensitivity)&&(Math.abs(coords.pageY-startPageY)<self.options.panSensitivity)) return true;
}

self.panning = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Pan sensitivity -> different PR.

@@ -1196,7 +1202,8 @@

var move = function(e) {
var coords;
e.preventDefault();
//e.preventDefault(); // chrome passive event warning https://www.chromestatus.com/features/5093566007214080 #328
e.stopPropagation();
Copy link
Contributor

Choose a reason for hiding this comment

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

You can add a comment that the use of stopPropagation is because preventDefault is not allowed.. But don't comment out the old code.

@jcnventura
Copy link
Contributor

That reverted all changes. The pull request is now useless, so I'll close it.

@jcnventura jcnventura closed this Jun 24, 2017
@inuyaksa
Copy link
Author

I'm working on it, you so fast and close my PR :)
I hope soon to publish 2 distinct PRs.

@timmywil
Copy link
Owner

@inuyaksa Sounds good. Thanks for the help!

@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 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.

None yet

3 participants