Skip to content

Fix natural scroll when reaching extent - #188

Open
spetex wants to merge 1 commit into
d3:mainfrom
spetex:fix-natural-scroll-when-reaching-extent
Open

Fix natural scroll when reaching extent#188
spetex wants to merge 1 commit into
d3:mainfrom
spetex:fix-natural-scroll-when-reaching-extent

Conversation

@spetex

@spetex spetex commented Aug 27, 2019

Copy link
Copy Markdown

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.

Comment thread src/zoom.js
.on("touchstart.zoom", touchstarted)
.on("touchmove.zoom", touchmoved)
.on("touchend.zoom touchcancel.zoom", touchended)
.style("touch-action", "none")

@spetex spetex Aug 27, 2019

Copy link
Copy Markdown
Author

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.

Comment thread src/zoom.js

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

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

Copy link
Copy Markdown
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