Page MenuHomePhabricator

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

Authored by aljungberg on Feb 19 2016, 10:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 16 2024, 7:47 AM
Unknown Object (File)
Mar 15 2024, 4:26 PM
Unknown Object (File)
Mar 15 2024, 4:25 PM
Unknown Object (File)
Mar 15 2024, 3:26 PM
Unknown Object (File)
Mar 15 2024, 2:35 PM
Unknown Object (File)
Mar 12 2024, 3:14 PM
Unknown Object (File)
Mar 12 2024, 1:43 PM
Unknown Object (File)
Mar 5 2024, 9:21 AM
Subscribers
Tokens
"Yellow Medal" token, awarded by chad.

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Commits
Restricted Diffusion Commit
rP4e40b17acae3: 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.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

aljungberg retitled this revision from to Don't mutate DOM by showing a tooltip on touch events.
aljungberg updated this object.
aljungberg edited the test plan for this revision. (Show Details)
aljungberg added a reviewer: epriestley.
This revision is now accepted and ready to land.Feb 19 2016, 1:05 PM
This revision was automatically updated to reflect the committed changes.