dotnet / dotnet/maui

CollectionView with single tap and long tap doesn't work on iOS

Open
#31,360 5 comments 0 reactions 0 assignees View on GitHub
area-controls-collectionview platform/ios s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

I have a CollectionView where I want to handle both a single tap item selection command and a long tap command. Long tap is not part of CollectionView and so I added the toolkit:TouchBehavior control in the item template. Like so:

```















```
The long press command opens a Popup view in which there are a number of buttons that the user can activate.
Works fine on Android but not on iOS.
On iOS the Popup view is shown but the clicked events of the buttons in there are not triggered. When the popup closes the global SelectionChangedCommand is executed.
I assume the issue is due to how event bubbling is happening on iOS.

This is a user interface scenario that I consider not to be uncommon for mobile apps. It doesn't work with iOS and so I am getting more and more the feeling that MAUI isn't there yet. I would think that this simple requirement should be provided out of the box. It unfortunately doesn't and it seems that there is nothing going on that makes this situation better in the near future.

Should I use something else than toolkit:TouchBehavior? If so, why isn't that documented?
Did I make the wrong decision to move to MAUI?

### Steps to Reproduce

Create a Page with the above xaml and an appropriate viewmodel.

### Link to public reproduction project repository

_No response_

### Version with bug

9.0.90 SR9

### Is this a regression from previous behavior?

Not sure, did not test other versions

### Last version that worked well

_No response_

### Affected platforms

iOS

### Affected platform versions

iOS 18.6

### Did you find any workaround?

No

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the XAML scenario on iOS 18.6, focusing on CollectionView.SelectionChangedCommand, toolkit:TouchBehavior, and the Popup buttons. Trace whether the CollectionView selection is consuming or receiving input after the long-press popup opens and closes. Done means the popup buttons respond and closing the popup does not unexpectedly execute the global selection command.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, ios
Domain
frontend, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.