dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.16k stars 1.74k forks source link

Dropping files into CollectionView not working on Mac Catalyst #16979

Closed torfluor closed 1 year ago

torfluor commented 1 year ago

Description

In our MAUI application, users can add PDF files, and the files names and other info is shown in a CollectionView. We want the user to be able to drag a file from Windows Explorer or the Mac Finder into the CollectionView, but this doesn't work on Mac Catalyst.

Steps to Reproduce

Please see the linked project that demonstrates the bug.

  1. Create a Page with a CollectionView
  2. Create a class under Platforms/MacCatalyst that implements UIDropInteractionDelegate
  3. Create a new UIDropInteraction and add it to the CollectionView
  4. Start the program and drag and drop a PDF file into the CollectionView

Expected result: PerformDrop in the delegate is called

What actually happens: PerformDrop is not called

Link to public reproduction project repository

https://github.com/torfluor/MAUICollectionViewDropTest

Version with bug

7.0.92

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

Venture 13.3

Did you find any workaround?

Not yet

Relevant log output

No response

ghost commented 1 year ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

torfluor commented 1 year ago

Drops into UICollectionViews can be handled by assigning a UICollectionViewDropDelegate to its DropDelegate. I have implemented this in the linked project which now works fine.

As this is was more of a shortcoming of the workaround than a bug in MAUI, I'll close this issue.