Repository navigation
Conversation
Touch Punch treats any touchmove on the sortable handle as a drag and suppresses the click, so tapping the disclosure arrow with slight finger movement never opened the item. Keep touches on the edit link from reaching the sortable so the browser can fire the click.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
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-handleis the sortable handle, including the arrow. jQuery UI Touch Punch treats anytouchmoveon the handle as a drag, cancelstouchstart, and suppresses the click the browser would have fired for the tap.How
A capture-phase
touchstartlistener on#menu-to-editstops 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
The keyboard and mouse paths are unchanged.
npm run build, PHPStan, and eslint are clean.composer lintreports only the pre-existing trunk baseline; no PHP files are touched.Props sukhendu2002 for the diagnosis in comment 19.