[Windows] - Handle Dynamic Updates for CanDrag and AllowDrop in Drag and Drop Gesture#27845
Merged
PureWeen merged 6 commits intodotnet:inflight/currentfrom Apr 18, 2025
Merged
Conversation
Contributor
|
Hey there @prakashKannanSf3972! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
suggested changes
Feb 18, 2025
|
|
||
| [Test] | ||
| [Category(UITestCategories.DragAndDrop)] | ||
| public void DragAndDropShouldWorkRunTime() |
Contributor
There was a problem hiding this comment.
This test is failing on Windows:
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2352
at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2367
at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 663
at Microsoft.Maui.TestCases.Tests.Issues.Issue12726.DragAndDropShouldWorkRunTime() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue12726.cs:line 23
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Contributor
Author
There was a problem hiding this comment.
Thank you for pointing this out! The failure appears to be due to the programmatic drop operation not functioning correctly on the Windows platform in the CI environment, despite working on local machines. I have modified the test accordingly, and it should pass in the next CI run.
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
|
/rebase |
f92c636 to
85ab80c
Compare
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
|
/rebase |
85ab80c to
5e37143
Compare
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
approved these changes
Apr 14, 2025
PureWeen
pushed a commit
that referenced
this pull request
Apr 23, 2025
…and Drop Gesture (#27845) * Fixed-Drag-And-Drop-RunTime * Modified-Test * Reverted-test * Modified-Code * Reverted-Unwanted-Changes * Modified.
prakashKannanSf3972
added a commit
to prakashKannanSf3972/maui
that referenced
this pull request
Apr 24, 2025
…and Drop Gesture (dotnet#27845) * Fixed-Drag-And-Drop-RunTime * Modified-Test * Reverted-test * Modified-Code * Reverted-Unwanted-Changes * Modified.
NanthiniMahalingam
pushed a commit
to NanthiniMahalingam/maui
that referenced
this pull request
Apr 24, 2025
…and Drop Gesture (dotnet#27845) * Fixed-Drag-And-Drop-RunTime * Modified-Test * Reverted-test * Modified-Code * Reverted-Unwanted-Changes * Modified.
prakashKannanSf3972
added a commit
to prakashKannanSf3972/maui
that referenced
this pull request
Apr 25, 2025
…and Drop Gesture (dotnet#27845) * Fixed-Drag-And-Drop-RunTime * Modified-Test * Reverted-test * Modified-Code * Reverted-Unwanted-Changes * Modified.
prakashKannanSf3972
added a commit
to prakashKannanSf3972/maui
that referenced
this pull request
Apr 28, 2025
…and Drop Gesture (dotnet#27845) * Fixed-Drag-And-Drop-RunTime * Modified-Test * Reverted-test * Modified-Code * Reverted-Unwanted-Changes * Modified.
github-actions bot
pushed a commit
that referenced
this pull request
Apr 28, 2025
…and Drop Gesture (#27845) * Fixed-Drag-And-Drop-RunTime * Modified-Test * Reverted-test * Modified-Code * Reverted-Unwanted-Changes * Modified.
PureWeen
pushed a commit
that referenced
this pull request
May 2, 2025
…and Drop Gesture (#27845) * Fixed-Drag-And-Drop-RunTime * Modified-Test * Reverted-test * Modified-Code * Reverted-Unwanted-Changes * Modified.
SuthiYuvaraj
pushed a commit
to SuthiYuvaraj/maui
that referenced
this pull request
May 9, 2025
…and Drop Gesture (dotnet#27845) * Fixed-Drag-And-Drop-RunTime * Modified-Test * Reverted-test * Modified-Code * Reverted-Unwanted-Changes * Modified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Details
Dynamically changing the
CanDragorAllowDropproperty does not enable the expected drag-and-drop functionality when initially set tofalse. As a result, components cannot be made draggable or droppable by updating these properties at runtime.Root Cause
Event subscriptions were only set up during initialization. Changing
CanDragorAllowDropdynamically did not trigger a re-subscription, preventing the component from responding to both drag and drop events.Description of Change
Added
PropertyChangedevent handling forDragGestureRecognizerandDropGestureRecognizerto ensure that drag-and-drop event subscriptions are updated dynamically when the properties change.Issues Fixed
Fixes #12726
Validated the behaviour in the following platforms
Output
Before-Fix.2.mp4
After-Fix.2.mp4