Skip to content

Correctly handle taps on desktop and clicks on mobile #106586

@justinmc

Description

@justinmc

The text editing stack does not correctly handle mouse events on mobile platforms and tap events on desktop platforms. We should survey the native behaviors in these situations and make sure Flutter behaves the same as native.

Current behavior

Currently, Flutter's behavior in these situations is mostly a relic of adding desktop/mouse support to a framework that was previously mobile/touch only.

For an example of touch events on desktop, double tapping on any desktop platform will show the text selection toolbar (code).

An example of mouse events on mobile would be that right clicking always shows the text selection toolbar (code) even on all mobile platforms.

We should survey these cases on our supported platforms and make sure Flutter behaves correctly.

Behaviors (todo)

Behavior Flutter app Native app
Right click on Android Show menu ?
Right click on iOS Show menu Nothing?
Double tap on Windows Shows menu Selects word, doesn't show menu
Double tap on Linux Show menu ?
Double tap on Mac Show menu ?
Long press on Windows Show menu Shows menu
Long press on Linux Show menu ?
Long press on Mac Show menu ?

Related

As of #104647, Flutter will strictly show the text selection menu based on the platform, not pointer type (tap vs. click).

CC @TahaTesser who I believe has discussed this problem with me before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: fidelityMatching the OEM platforms bettera: mouseIssues related to using a mouse or mouse supportc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions