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 natural scroll when reaching extent #188

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix natural scroll when reaching extent #188

wants to merge 1 commit into from

Conversation

spetex
Copy link

@spetex spetex commented Aug 27, 2019

As discussed in the issue: #186

I am preventing pan and event cancellation if the content has reached the translateExtent.

I have tested this on an iPhone and multiple different browsers I have on my laptop.

@@ -76,7 +77,6 @@ export default function() {
.on("touchstart.zoom", touchstarted)
.on("touchmove.zoom", touchmoved)
.on("touchend.zoom touchcancel.zoom", touchended)
.style("touch-action", "none")
Copy link
Author

@spetex spetex Aug 27, 2019

Choose a reason for hiding this comment

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

Have not found the reason for this class. It unfortunately prevents natural page scroll to apply. We can probably programatically add and remove the class during the touchmove if it is necessary.


var move = constrain(translate(t, p, l), g.extent, translateExtent);

if ((move.x != 0 || move.y != 0) && !touchScroll) {
Copy link
Author

Choose a reason for hiding this comment

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

touchScroll we need to prevent the noevent() when you are already scrolling the page, the browser ingores it anyways

@Fil Fil mentioned this pull request Jul 10, 2020
@Fil Fil mentioned this pull request Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant