Make WordPress Core

Opened 2 years ago

Last modified 2 weeks ago

#62451 new defect (bug)

Menu editing broken on mobile

Reported by: androidacy Owned by:
Priority: normal Milestone: Future Release
Component: Menus Version: 6.7
Severity: normal Keywords: needs-test-info has-patch
Cc: Focuses: administration

Description

On mobile devices, places where elements can be dragged and dropped such as menu editing prevent any clickable items from being clicked (i.e. tapping the down arrow on a menu item does nothing besides initiate a drag).

Tested on: chrome v131

Change History (20)

#1 @im3dabasia1
2 years ago

Hi @androidacy,

Thank you for your first ticket contribution!

Could you please share the steps to reproduce the issue you're experiencing? A screen recording would also be incredibly helpful in understanding and replicating the problem.

#2 @priyankkpatel
2 years ago

Hi @androidacy ,
I tried to reproduce the issue, but I can't. I checked the down arrow button after creating 3 level menu and can click a single one of those.
Please try to check the same in new WordPress setup.
Thanks

#3 @sabernhardt
2 years ago

  • Milestone Awaiting Review → 6.8

I needed to tap the very edge of the element to expand each menu item in Chrome 130 + Android 11. It seems to have been an issue already in 6.6.2 (and possibly earlier).

#4 @audrasjb
21 months ago

  • Keywords needs-patch added

This ticket was mentioned in ​Slack in #core by audrasjb. ​View the logs.


20 months ago

#6 @audrasjb
20 months ago

  • Milestone 6.8 → 6.9

As per today's bug scrub: Due to lack of activity on this ticket during this cycle, let's move it to the next milestone.

#7 @vishalkakadiya
20 months ago

Hi @androidacy @sabernhardt,

I tried to reproduce this issue on my end but I can't able to reproduced it.

  • The dropdown for posts/pages selection is working fine, if we click on the label the panel is opening fine for post selections.
  • The drag-drop selection for sorting the order of menu items is also working fine. To open a post which is added to the menu item we must click the right side arrow icon to open it and this behaviour is the same in Desktop as well.

If possible, Can you share the steps to reproduce this for the next steps on this?

Thanks!

#8 @riccardodicurti
18 months ago

I tested this on a real mobile device using Chrome v137 and WordPress 6.8.1.
In the Menus screen (/wp-admin/nav-menus.php), I was able to tap the down arrow to expand menu items without any issues. The drag behavior did not interfere with tapping controls.

It seems the issue reported in Chrome v131 may no longer be present in newer versions.

#9 @androidacy
18 months ago

Still very much an issue on edge (chromium based) mobile 137. Tapping anywhere but the exact edge does not expand as expected.

Sorry for delayed response, notifications are getting sent to spam

#10 @androidacy
18 months ago

​https://limewire.com/d/GzUWg#DubRI9ZABw screen recording (link expires in a week)

#11 follow-ups: @mehul0810
17 months ago

I have tested with WP version 6.8.1 and able to replicate the issue.

Steps to reproduce

  1. Go to Appearance > Editor > Navigation
  2. Ensure that you have atleast 3-4 menu items already there
  3. Issue: the drag and drop of menu items and the 3 dots to the right of each menu item visibility on hover doesn't work
  4. After investigating it seems that it is not an issue with screen size. But, it seems that the touch event is not working properly. So, when you "Inspect Element" and switch to see responsive screens where touch event is enabled, the issues mentioned in point (3) wont work in any screen size.

See here: ​https://share.cleanshot.com/Tgf89LFMCcKtf0cYt4lX

#12 in reply to: ↑ 11 @SirLouen
17 months ago

Replying to mehul0810:

I have tested with WP version 6.8.1 and able to replicate the issue.

Hi mehul, It's always useful to provide some testing environments attached to your steps
When making a report like this, I would recommend you to use the plugin "Test Reports", as it provides a little easy template with all the most useful system environments for a quick copy/paste

#13 @mehul0810
17 months ago

@SirLouen Thanks for the details. Please find the reproduction report below.

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 6.8.1
  • PHP: 8.3.0-dev
  • Server: PHP.wasm
  • Database: WP_SQLite_Translator (Server: 5.5 / Client: 3.40.1)
  • Browser: Chrome 137.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Error condition occurs (reproduced)

Steps to Reproduce

  1. Go to Appearance > Editor > Navigation
  2. Ensure that you have atleast 3-4 menu items already there
  3. Issue: the drag and drop of menu items and the 3 dots to the right of each menu item visibility on hover doesn't work
  4. After investigating it seems that it is not an issue with screen size. But, it seems that the touch event is not working properly. So, when you "Inspect Element" and switch to see responsive screens where touch event is enabled, the issues mentioned in point (3) wont work in any screen size.

Supplemental Artifacts

​https://share.cleanshot.com/Tgf89LFMCcKtf0cYt4lX

#14 @fclaussen
13 months ago

I just tested this and I can tap the arrow just fine.

  • Google Pixel 8 pro
  • Chrome 141.0.7390.70
  • WordPress 6.7 AND 6.8.3
  • PHP 8.3.23

​https://www.youtube.com/shorts/_2O7v_A6pHM

Last edited 13 months ago by fclaussen (previous) (diff)

#15 @wildworks
13 months ago

  • Keywords needs-test-info added
  • Milestone 6.9 → 7.0

In this issue, I think it seems unclear what exactly should be tested first. It also seems unclear in this ticket whether "menu" refers to one of the following two options:

We need accurate information on which menu items should be tested.

Since it's not yet clear which one we should test at this point, I'd like to punt it to 7.0.

This ticket was mentioned in ​Slack in #core by audrasjb. ​View the logs.


9 months ago

#17 @audrasjb
9 months ago

  • Milestone 7.0 → Future Release

As per today's 7.0 bug scrub:
Moving to Future Release as the ticket wasn't updated since cycle 6.9 and no patch is available (still investigating on reproduction steps).

#18 in reply to: ↑ 11 @sawf1y
3 months ago

Replying to mehul0810:

I have tested with WP version 6.8.1 and able to replicate the issue.

Steps to reproduce

  1. Go to Appearance > Editor > Navigation
  2. Ensure that you have atleast 3-4 menu items already there
  3. Issue: the drag and drop of menu items and the 3 dots to the right of each menu item visibility on hover doesn't work
  4. After investigating it seems that it is not an issue with screen size. But, it seems that the touch event is not working properly. So, when you "Inspect Element" and switch to see responsive screens where touch event is enabled, the issues mentioned in point (3) wont work in any screen size.

See here: ​https://share.cleanshot.com/Tgf89LFMCcKtf0cYt4lX

Sir, no mobile device (known to me) can fire a hover event because they can't predict which element a person's finger is hover over. Thanks for the steps to reproduce.
I'm going to take this to work if no one objects. Since I'm completely new to WordPress and have only recently started contributing, this might take me a lot longer than someone experienced. So if anyone knows exactly how and where to fix this and is willing to fix this bug, please let me know in the comments.
I think this issue could be ignored since the three dots are available after touching the element. But the three dots menu doesn't allow you to create submenus from the available items, only reordering them on the same level. Thoughts: Should we consider extending the functionality of the three dots menu to allow it to create submenus within this ticket, or as a future enhancement?

#19 @sukhendu2002
6 weeks ago

I tested both menu interfaces against current trunk.

Classic Menus (/wp-admin/nav-menus.php)

The original issue is reproducible. A stationary tap on the menu item’s disclosure arrow works, but introducing only one pixel of touch movement prevents the item from expanding.

The entire .menu-item-handle, including the .item-edit link, is configured as the sortable handle. On mobile, Touch Punch treats any touchmove as dragging and does not synthesize the final click.

Site Editor Navigation (/wp-admin/site-editor.php?p=%2Fnavigation)

The findings are different:

  • The three-dot Options control appears after tapping/selecting the row.
  • Both an exact tap and a tap with one pixel of movement opened the Options menu.
  • “Move up” and “Move down” worked on touch.
  • Touch drag-and-drop did not work. Touch and pointer events fired, but no native dragstart event occurred and the item order did not change.
  • The desktop mouse control emitted dragstart/drop and reordered the items successfully.

The Options menu only supports same-level movement. Adding a touch-accessible way to create submenus would be a separate enhancement.

Based on these results, I suggest keeping this ticket scoped to the original classic Menus disclosure problem. The Site Editor touch drag-and-drop failure should be reported separately against Gutenberg’s Block Editor/List View.

This ticket was mentioned in ​PR #15327 on ​WordPress/wordpress-develop by ​@sarequl.


2 weeks ago
#20

  • Keywords has-patch added; needs-patch removed

Fixes the classic Menus disclosure arrow on touch devices.

See https://core.trac.wordpress.org/ticket/62451

What

On touch devices, tapping a menu item's disclosure arrow (.item-edit) only expanded the item when the finger stayed perfectly still. Any movement, even 1px, started a drag and the settings panel never opened.

Why

The whole .menu-item-handle is the sortable handle, including the arrow. jQuery UI Touch Punch treats any touchmove on the handle as a drag, cancels touchstart, and suppresses the click the browser would have fired for the tap.

How

A capture-phase touchstart listener on #menu-to-edit stops propagation when the touch starts inside .item-edit, so Touch Punch never sees it and the browser fires the click. The listener is delegated, so items added via AJAX are covered. Reordering from the rest of the handle is unchanged.

Testing Instructions

  1. On a touch device (or mobile emulation), open Appearance → Menus with a menu that has a few items.
  2. Tap the disclosure arrow on an item, allowing about 1px of finger movement. The item expands and its settings appear. On trunk this fails; a perfectly still tap works.
  3. Drag an item by its handle to reorder it. The order still changes.
  4. With a mouse, click the arrow; it expands. Focus the arrow and press Enter; it toggles.

The keyboard and mouse paths are unchanged. npm run build, PHPStan, and eslint are clean. composer lint reports only the pre-existing trunk baseline; no PHP files are touched.

Props sukhendu2002 for the diagnosis in comment 19.

Note: See TracTickets for help on using tickets.