HomePhabricator

Don't mutate DOM by showing a tooltip on touch events

Description

Don't mutate DOM by showing a tooltip on touch events

Summary:
This fix further addresses T10229. The problem and solution are the same:

  • If the DOM is mutated during a touch, it never registers as a 'click' so the tapped button does not activate.
  • This was partially addressed in D15136, which covered taps on code lines in a Differential view.
  • Tapping on some buttons, like "Reply" or "Hide Comment" still caused the problem by showing a tooltip.
  • There are probably similar buttons elsewhere, other than in Differential, exhibiting the same 'needs multiple taps to work' behaviour.
  • The testing in the iOS simulator performed for D15136 did not reveal that the problem with "Hide comment" and such remained because the small device size used for testing triggered the != 'desktop' path for tooltips.

To fix it:

  • Don't show tooltips for touch events. You can't 'hover' with a finger (with today's tech) so that UI paradigm doesn't apply.
  • Show the tooltips for regular mouse events, even if they are on the same device. Some devices have both touch and a mouse.
  • No longer try to rely on a distinction between 'desktop' and 'mobile' devices. Mobile devices like the iPad Pro are essentially desktop like, and as mentioned above, a single device could be both touch and mouse enabled. It's not about the nature of the device, it's about the nature of the interaction.

Test Plan:

  • Tapped "Hide Comment", "Reply" on an iPad Pro running iOS 9.2 and got single touch responses with no tooltips.
  • Tried the same on an iPhone 6 running iOS 9.2.
  • Hovered over the same on a regular desktop in Safari and saw tooltips. Clicked and saw regular reactions.

Reviewers: epriestley, Blessed Reviewers

Reviewed By: epriestley, Blessed Reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15310

Details

Provenance
aljungbergAuthored on Feb 19 2016, 1:06 PM
epriestleyCommitted on Feb 19 2016, 1:06 PM
epriestleyPushed on Feb 19 2016, 1:07 PM
Reviewer
Blessed Reviewers
Differential Revision
D15310: Don't mutate DOM by showing a tooltip on touch events
Parents
rP5eecff91cdd3: Move Diffusion ReadmeView to PHUIDocumentProView
Branches
Unknown
Tags
Unknown
Build Status
Buildable 10775
Build 13264: Run Core Tests