Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22595 closed defect (bug) (worksforme)

iPad Image Un-Select Alternates Between 1 and 2 Taps

Reported by: miqrogroove's profile miqrogroove Owned by:
Milestone: Priority: low
Severity: minor Version: 3.5
Component: Media Keywords: needs-testing has-patch
Focuses: Cc:

Description

Steps to reproduce:

  1. Open the new media modal.
  2. Go to the Media Library tab.
  3. Select (tap) an image.
  4. Un-select the image by tapping on the blue check mark.

Expected Result:

Image selection removed.

Actual Result:

Every-other attempt is successful on first tap. Otherwise, a second tap is required.

Attachments (2)

22595.patch (1.7 KB) - added by azaozz 11 years ago.
mobile-events-test.html (2.4 KB) - added by azaozz 11 years ago.

Download all attachments as: .zip

Change History (14)

#1 @miqrogroove
11 years ago

Additionally: with multiple images selected, tapping on the grey check marks on various images has seemingly random results.

#2 @koopersmith
11 years ago

Ah. This is due to the hover state attempting to kick in before the click event. We should probably just disable the hover state on mobile devices.

#3 @nacin
11 years ago

  • Milestone changed from Awaiting Review to 3.5

#4 @koopersmith
11 years ago

  • Keywords needs-testing needs-patch added
  • Priority changed from normal to low

Haven't been able to find a way to consistently disable or override the hover event on iOS. Patches and documentation of other OS behavior welcome.

#5 @azaozz
11 years ago

Generally touchstart works better than click in iOS Safari and if cancelled prevents the fake 'click` event from firing. Perhaps we can use that, not for Android though. Will look into it this afternoon.

@azaozz
11 years ago

#6 @azaozz
11 years ago

22595.patch fixes this for iOS6 Safari. It uses 'touchstart' instead of 'click' to select, deselect and remove from selection. Only tested on iPad but should work the same on all other iOS6.

#7 @nacin
11 years ago

  • Keywords has-patch added; needs-patch removed

#8 @azaozz
11 years ago

mobile-events-test.html​ is a small test of mouse events for touchscreen devices/browsers.

Results for iOS Safari:

touchstart
touchend
mouseover
mousedown
mouseup
click
------------------
touchstart (prevented)
touchend
------------------
touchstart
touchend (prevented)
------------------

and for Android 2.1 (Kindle Fire 1)

touchstart
touchend
mouseover
mousedown
mouseup
click
------------------
touchstart (prevented)
touchend
------------------
touchstart
touchend (prevented)
mouseover
mousedown
mouseup
click
------------------

Preventing default for touchstart cancels the emulated mouse events in both, preventing it for touchend cancels them in iOS but not in Android 2.1. Would be good to see what happens in Android 4 :)

Looking at the ticket further: the unselecting of images/attachments by touching the checkmark seems to work properly in iOS Safari now. We probably can attach it to both touchstart and click, and cancel both.

#9 @azaozz
11 years ago

  • Milestone 3.5 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Closing as worksforme for now. If this still persists, can reopen and add 'touchstart' event there too.

#10 @koopersmith
11 years ago

As discussed in IRC. If this is still occurring, please reopen this ticket.

#11 @miqrogroove
11 years ago

reading...

#12 @miqrogroove
11 years ago

Seems fixed on 3.5-RC2-22958. Thanks :)

Note: See TracTickets for help on using tickets.