Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Buttons not firing after clicking into element having touch behavior even when behavior IsEnabled="False" (Mac Catalyst) #1853

Open
2 tasks done
sumowesley opened this issue May 2, 2024 · 3 comments
Labels
area/behaviors Issue/Discussion/PR that has to do with Behaviors bug Something isn't working unverified

Comments

@sumowesley
Copy link

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

Two Buttons have commands associated with them. These buttons are not within the area controlled by the touch behavior. Once we've clicked in the area with the touch behavior (even if the behavior is disabled), the buttons no longer run the commands. You must move the cursor outside of the current application window and return, and the buttons now fire.

Expected Behavior

Buttons should be active at all times and not impacted by clicking within the area that has touch behaviour.

Steps To Reproduce

  1. Run the repo project within Mac Catalyt
  2. Click either button to see it's name as an alert
  3. Click inside one of the list items in the view
  4. Click on either button (no popup)
  5. Move the cursor off the active Window
  6. Move the cursor back to the active Window and click the buttons to see the command active once more
  7. Turn on Grid Behavior using the button
  8. Click and hold an item in the list and then drag away like you want to cancel
  9. Click the buttons. Now inactive.
  10. Repeat steps 5 and 6 to reactive the buttons

Link to public reproduction project repository

https://github.com/sumowesley/BaseMaui.git

Environment

- .NET MAUI CommunityToolkit: 8.01
- OS: Sonoma 14.4.1
- .NET MAUI: 8.0.21

Anything else?

iOS, Android and Windows work as expected.

@sumowesley sumowesley added bug Something isn't working unverified labels May 2, 2024
@dainius-r
Copy link

I have very similar issue it might be connected. I have CollectionView when using TouchBehavior with LongPressCommand on every item in collection, it disables CollectionView selection functionality, setting IsEnabled="False" on TouchBehavior won't impact collection, basically TouchBehavior blocks CollectionView selection.
Would be nice if TouchBehavior work together with other controls or IsEnabled not only disabled commands but also touch capturing.
Only workaround that I found, put TouchBehavior inside some Grid on top, and when not needed, set Grid visibility to False.

@vhugogarcia vhugogarcia added the area/behaviors Issue/Discussion/PR that has to do with Behaviors label May 5, 2024
@sumowesley
Copy link
Author

I've just updated the Community.Toolkit.Maui, and the problem still exists on Mac Catalyst.

@sumowesley
Copy link
Author

Have there been any updates to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/behaviors Issue/Discussion/PR that has to do with Behaviors bug Something isn't working unverified
Projects
None yet
Development

No branches or pull requests

3 participants