Skip to content

[css-ui] Consider adding a new property for disabling context menu on long press on mobile #3523

@upsuper

Description

@upsuper

On mobile browsers, long pressing certain kinds of elements would trigger a context menu to show up, this is sometimes undesired.

One case of that is for dragging target, that users may not have decided where to drag to before they start pressing, and the popup context menu may break such work flow.

iOS has -webkit-touch-callout property specifically for handling this, but it's not available elsewhere.

There are several suggested workarounds for this on Android, like invoking preventDefault on contextmenu event, or maybe even touchstart event, or using pointer-events: none for the specific elements. But they all involve some trade-offs so may not fit in all the cases.

Given these, I think it's probably good to have a standard property for controlling this, and I guess CSS UI spec is where such property should be in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions