PSA: Simultaneous touch-drag and context-menu is getting enabled on Android 100+

502 views
Skip to first unread message

Mustaq Ahmed

unread,
Jun 16, 2022, 12:31:09 PM6/16/22
to blink-dev

On Android we are soon enabling touch-dragging following a long-press, which could subtly affect custom context-menu closing behavior in certain websites.  We are not exposing any events that didn't exist before but we are changing when these events may fire on some devices/content.  This can cause two changes in observable behavior in Chrome for Android:

  • Elements with a draggable attribute would start responding to touch-drag interaction.

  • Custom context-menu may co-exist with an ongoing drag.

Draggable elements

On mobile we never supported drag-and-drop, so draggable elements (like those in this demo) never really responded to touch-drags.  More precisely, we fired neither drag nor dragend events after a dragstart event, and in many cases we couldn’t fire even a dragstart event because a long-press would invoke a modal context menu which blocks all events from the page behind.


This upcoming change would expose correct firing of dragstart, drag and dragend events to the page, and any draggable element would start responding.

Custom context menus

The upcoming change would possibly provide an awkward experience on sites that draw a custom context-menu.  Certain types of target elements would now receive both dragstart and contextmenu events, so some of these sites would continue to show a custom context-menu while a drag-and-drop is ongoing.  But any reasonable custom context-menu is expected to close on a tap outside the menu, and that would be an easy and intuitive “fix” for the user.  So in the end, this would feel like a bad UI experience instead of a broken site.

Future plans

Longer term, we are proposing to enhance custom context-menu support in the Web platform through a new event:

Creature Feature

unread,
Jun 29, 2022, 10:53:58 AM6/29/22
to blink-dev, Mustaq Ahmed
Hello, I have recently became aware of this and I am having a slight issue - when I am trying to open context menu to say open a new tab, the drag function is overriding my hold function and the context menu is getting cancelled in an instant. No idea how to tackle the issue.

Mustaq Ahmed

unread,
Jun 29, 2022, 2:42:12 PM6/29/22
to Creature Feature, blink-dev
The Android team is apparently seeing reports like yours.  Please comment on this bug about your experience.

Reply all
Reply to author
Forward
0 new messages