Skip to content

[BUG] TouchBehavior does not work on Button in Windows #2538

Open

Description

@TheInnoventor

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

TouchBehavior does not seem to work on Button controls in Windows. Works as expected on Android. Command (short click/tap) and LongPressCommand are nether one triggered when using TouchBehavior on a Button. Moving the TouchBehavior definition up to a Label (and changing it to a Label type obviously) works as expected on both platforms. Moving it to an Image also works on both platforms. Moving it back to the Button results in the short and long taps being registered on Android only, and not Windows.

Expected Behavior

I expect that TouchBehavior (particularly Long Presses) work the same way across platforms.

Steps To Reproduce

  1. Open attached project (which is a File New project with the DotNet bot image and I added some TouchBehaviors).
  2. Build and run Android version.
  3. Observe that a quick tap and a LongPress works on the Button, the bottom Label, and the Image. Both TouchBehaviors work on all 3 controls on Android.
  4. Build and run Windows version.
  5. Observe that clicking the Label and the Image works as expected. Also observe that a LongPress (with the mouse click) also works as expected.
  6. Observe that clicking the Button does not work, nor does a LongPress. Neither TouchBehavior works on the Button in Windows.

Link to public reproduction project repository

https://github.com/TheInnoventor/LongPressTest

Environment

- .NET MAUI CommunityToolkit: 11.1.0
- OS: Windows 10
- .NET MAUI: 9.0.40

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/behaviorsIssue/Discussion/PR that has to do with BehaviorsbugSomething isn't workingunverified

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions