Skip to content

Conversation

@rschiang
Copy link

@rschiang rschiang commented Feb 4, 2018

This PR adds the double-tap detection to the extension, in the same behavior as Android or iOS.

(Though double two-finger taps could be more feasible under OS X (macOS), W3C touch events are disabled and lacking trackpad support as of Firefox 59; could be done after touchstart and related events are correctly implemented in FF.)

@theotheroracle
Copy link

would this override Firefox default double tap to select feature?

@rschiang
Copy link
Author

rschiang commented Feb 24, 2018 via email

@rschiang
Copy link
Author

I've implemented a simple options page on another branch which enables toggling two functionalities:

Screenshot

Should I start another PR or merge it into this one? 🐙

@haxiomic
Copy link
Owner

haxiomic commented Feb 25, 2018

Hey @rschiang, great stuff, thanks :), agree regarding a zoom speed setting – that would be a useful feature. Let's merge the PR into a new branch for now while we work out the kinks (I think a new PR is the easiest way to do this)

I've been fiddling with the double-tap interaction for a little while and I think it needs some tweaks – @pifi is right in that double-tap with a single finger is normally used to select text.

I find I use double-tap to select text fairly often, especially when zoomed-in since the increased scale makes it easier to hit the right spot, so I don't think by default we should change the behavior here

Additionally we've got to make sure the click event is canceled so that the gesture doesn't trigger actions on the page (like trying to zoom in on a link or button)

Solutions I can see at the moment

  • Support double-tap 1 finger but disable it by default
    • To prevent spurious text-selection we could forcefully deselect any text that was selected by the gesture
    • A hidden fullscreen element could be used to capture the click event before anything responds to it (but this may behave strangely with other pages)
  • Same as above, enabled by default but with a modifier key like shift
  • Come up with another gesture or a way of capturing two-finger gestures

If we support double-tap to zoom-out we should also support double-tap to zoom-in (like Chrome and mobile), I had some tests with this working with single-finger double-tap by the text selection issue was too annoying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants