microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

Drag and drop for navigation seems broken in lastest pre-release!

Open Parth opened this issue 5 years ago • 18 comments
trafficstars

Prompted by https://github.com/microsoft/microsoft-ui-xaml/issues/3131 issue I was asked to update to the latest pre-release.

Updating to this seems to completely disable drag and drop regardless of CanDrop and related settings.

Parth avatar Sep 16 '20 01:09 Parth

@Parth Was this working for you in a 2.5 pre-release but then regressed in a newer one? Could you specify which release it was working in and which one it stopped ? What do you mean by drag and drop being disabled ?

ranjeshj avatar Sep 16 '20 13:09 ranjeshj

Not sure if you looked into the issue I linked. Before the prerelease I was facing a bug regarding highlight of the navigationview. But here drag and drop is working. This video doesn't capture the tooltip I see when I drag and drop (perhaps a bug in game bar or whatever) but you can see both drag and drop working and the bug I talked about in #3131 in this video.

2.4.3: https://youtu.be/1MSW26ipDls

Now in the 2.5 prerelease (I tried them all), one of these issues is solved, but another is created: https://youtu.be/aCfrSwZzdjI

None of the code has changed, regardless of how hard I try dragging and dropping just behaves as if all of the CanDrag and various other flags related to drag and drop are set to false.

Parth avatar Sep 18 '20 00:09 Parth

@Parth would you be able to share a small repro app showing your issue ? That would really help debug. @StephenLPeters can you think of any recent changes NavView change that could have caused this ? It might be worth adding a test for this scenario.

ranjeshj avatar Sep 18 '20 18:09 ranjeshj

@chingucoding and/or @Felix-Dev did the change to treeview's drag and drop behavior get checked in already? could that be causing this?

StephenLPeters avatar Sep 18 '20 18:09 StephenLPeters

Silly me, H-Navview doesn't use tree view

StephenLPeters avatar Sep 18 '20 18:09 StephenLPeters

I don't think that those went in yet, but even if so, NavigationView uses ItemsRepeater, not Treeview so that shouldn't make a difference.

marcelwgn avatar Sep 18 '20 18:09 marcelwgn

@StephenLPeters Exactly as @chingucoding said :)

Felix-Dev avatar Sep 18 '20 19:09 Felix-Dev

@ranjeshj I believe you could create a minimal repro with UWP sample code + add drag and drop to the NavigationView components.

My source is available here. More specifically this is my xaml (very small). You wouldn't have any problems running the project as is.

Parth avatar Sep 19 '20 20:09 Parth

The newest prerelease (9.23, and all the other 2.5.*) also breaks muxc:NavigationView.PaneFooter:

behavior in 2.4:

image

behavior in the 2.5 prereleases:

image

Notice the footer has been pushed down.

I think there's a serious regression to the NavigationView in 2.5 and someone needs to take a serious look at an example with:

  • Hierarchical navigation (with lots of elements to verify scroll behavior)
  • Drag and drop
  • Footer

The surface area of the app I've linked is really pretty low, and is a reasonable starting point for such an effort.

I would be happy to assist in the effort, but as it stands right now, there's a minor bug in 2.4 associated with this element, and a major bugs in all the 2.5 releases, and it's pretty concerning, to say the least.

Parth avatar Sep 27 '20 20:09 Parth

@Parth Can you open a new issue for this specific Footer/Settings button behavior? (I am seeing this as well in case of the Settings item. With latest two WinUI 2.5 previews, the Settings item is now no longer always visible but will be pushed out of the screen by NavigationView menu items (if there are enough visible). I don't think this change was intended but more can be discussed in its own issue on the repo. This change seems to have happened as part of the recent footer menu items work.)

Felix-Dev avatar Sep 27 '20 21:09 Felix-Dev

I don't think this was intended either. Lets get it a dedicated issue and we can see about fixing it for the next prerelease.

StephenLPeters avatar Sep 28 '20 18:09 StephenLPeters

I am getting this same issue after updating to WinUI 2.5.

yaira2 avatar Dec 04 '20 17:12 yaira2

This seems to be still an issue even on 2.7.0, and also on 2.6.2 and below. I created a simple test using XAML Controls Gallery.

I made a simple test adding "CanDrag="True" on a release that have the WinUI 2.4.0-prerelease.200414001, and on the last main commit, that have WinUI 2.7.0-prerelease.210816001.

On the 2.4.0 it's working as expected, while on the 2.7.0 no.

2.4.0 version, with the last NavigationView example, which is the one that I modified, is working: GIF 07-09-2021 18-48-19

2.7.0 version, with the same modification on the last NavigationView example, is not working: GIF 07-09-2021 19-04-50

You can check those examples with that little modification on my fork:

2.4.0 which is working: https://github.com/BanCrash/Xaml-Controls-Gallery/tree/2.4.0-prerelease.200414001

2.7.0 which is not working: https://github.com/BanCrash/Xaml-Controls-Gallery/tree/2.7.0-prerelease.210816001

NOTE: I understand that 2.7.0 is a preview version, but on stable versions of 2.5 / 2.6 is not working neither...

BanCrash avatar Sep 07 '21 17:09 BanCrash

Unfortunately we've yet to have the bandwidth to prioritize this :( We understand it is broken but are juggling competing priorities.

StephenLPeters avatar Oct 26 '21 17:10 StephenLPeters

PSA, we are using the winui 2.8 milestone for tracking purposes, it is not meant to indicate that we are committing to that work.

StephenLPeters avatar Oct 26 '21 17:10 StephenLPeters

It's been 2 years. Any update for this bug?

ReneeGA2020 avatar Aug 07 '22 12:08 ReneeGA2020

I have a potential workaround for this issue.

image

Setting "CanDrag" to the NavigationItemView alone isn't enough, I also need to set it to the underlying NavigationItemViewPresenter. Then, magically, once I did that, I could drag and drop items on the NavigationView again.

drasticactions avatar Jan 22 '23 15:01 drasticactions

This allows dragging but does not trigger DragStarting

hecksmosis avatar Feb 22 '23 19:02 hecksmosis

@hecksmosis You should be able to attach that to the NavigationItemViewPresenter as well. https://github.com/drasticactions/MauiFeed/blob/main/src/MauiFeed.WinUI/Views/FeedSidebarItem.cs#L237-L252

I have an example of it in my app. Basically, you would attach that the same way as you would normally to a given element.

https://github.com/drasticactions/MauiFeed/blob/main/src/MauiFeed.WinUI/Views/FeedSidebarItem.cs#L256-L281

Note that this is very much a "workaround" hack and shouldn't be needed. It would be great if the underlying issue here would be fixed, as it should be possible to do this with a Navigation item normally, and I'm not sure what's blocking it from working.

drasticactions avatar Feb 25 '23 03:02 drasticactions

There are a number of use cases where this bit of functionality would be useful. I understand that there may be competing priorities for the next release, but it would be great if this could be looked at with it being in the backlog for nearly 2 years.

JoeTomkinson avatar Apr 29 '23 19:04 JoeTomkinson

Are there any updates on this issue?

yaira2 avatar Jul 13 '23 14:07 yaira2