WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#20557 closed enhancement (fixed)

Sortable meta boxes are too touchy

Reported by: helenyhou Owned by: nacin
Milestone: 3.4 Priority: normal
Severity: normal Version:
Component: UI Keywords: has-patch commit
Focuses: Cc:

Description

When scrolling a screen with many sortable meta boxes on a touch device, there is a high likelihood of inadvertently dragging a meta box around. This becomes very frustrating very quickly.

Attachments (4)

20557.diff (377 bytes) - added by helenyhou 3 years ago.
20557-revised.diff (416 bytes) - added by georgestephanis 3 years ago.
Please confirm, but this should apply the change only on 'mobile' (touch screen) devices.
quicker-method.diff (805 bytes) - added by georgestephanis 3 years ago.
tweaked the last patch for speed, and modified another ifcheck to use the body class (which has much more logic thrown into it in the back-end than just checking the UA string)
quicker-method.corrected.diff (748 bytes) - added by georgestephanis 3 years ago.
Whoops, used the longhand version in the last try.

Download all attachments as: .zip

Change History (10)

@helenyhou3 years ago

comment:1 @helenyhou3 years ago

  • Keywords has-patch added

20557.diff introduces a delay of 200 to adjust. This does not seem to impact actual dragging into place on a computer, as mouse movement to drag takes at least that long to accomplish.

comment:2 @DrewAPicture3 years ago

  • Cc xoodrew@… added

Had the same problem on my TouchPad. The patch adds just enough delay to remove the annoying-factor. +1

comment:3 @nacin3 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 3.4

@georgestephanis3 years ago

Please confirm, but this should apply the change only on 'mobile' (touch screen) devices.

comment:4 @nacin3 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [20614]:

Add a 200ms delay when dragging a meta box on mobile devices, to prevent inadvertently dragging meta boxes around on a touch screen.

props helenyhou, georgestephanis. fixes #20557.

@georgestephanis3 years ago

tweaked the last patch for speed, and modified another ifcheck to use the body class (which has much more logic thrown into it in the back-end than just checking the UA string)

comment:5 follow-up: @georgestephanis3 years ago

Not sure if it's worth changing to this latest patch, but it may speed one bit up and tidy another.

@georgestephanis3 years ago

Whoops, used the longhand version in the last try.

comment:6 in reply to: ↑ 5 @azaozz3 years ago

Replying to georgestephanis:

In theory:

  • $('body').hasClass('mobile') is pretty fast,
  • document.body.className.match(/mobile/) is few milliseconds faster but could potentially match something else (class like 'not-mobile'),
  • $(document.body).hasClass('mobile') is another way to reference the body and seems a tiny bit faster than the tag name above.
Note: See TracTickets for help on using tickets.