Skip to content

Implement correct iOS button press dynamics #19786

@matthew-carroll

Description

@matthew-carroll

I noticed a certain behavior in iOS alert dialogs when buttons are pressed. This behavior might be generic to iOS, or it might be specific to alert dialogs. Either way, the following behavior should be implemented.

Dragging between buttons while pressed:
Consider an alert dialog with an "OK" button and "Cancel" button sitting next to each other. The user presses on the "OK" button causing that button to appear pressed. Then, while pressing on the "OK" button, the user drags over to the "Cancel" button. On iOS this causes the "OK" button to go back to the normal state, and causes the "Cancel" button to now appear pressed. Moreover, if the user releases the "Cancel" button then the "Cancel" button receives the tap event.

The above tap/drag behavior is also true for vertical lists of buttons in an alert dialog.

What about scrollable lists of buttons?
If the buttons overflow and are scrollable then the behavior is different. When the user presses down on a button it causes the expected effect. When the user starts dragging beyond the "slop" then the button press disappears and vertical scrolling begins. This is a typical and expected behavior. I believe this is the behavior we have today. We need to make sure that this aspect of our behavior remains unchanged.

What happens when the user presses multiple buttons with multiple fingers?
TODO: I need to verify this on a physical device. Will update when I try it.

CC @Hixie @xster

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms betterf: cupertinoflutter/packages/flutter/cupertino repositoryfound in release: 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions