-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Catalyst] Fixed the CanMixGroups Set to False Still Allows Reordering Between Groups in CollectionView #28623
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Binary file added
BIN
+10.8 KB
...snapshots/android/ReorderBetweenGroupsShouldNotOccurWhenCanMixGroupsIsFalse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions
33
src/Controls/tests/TestCases.HostApp/Issues/Issue28530.xaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Maui.Controls.Sample.Issues.Issue28530"> | ||
|
||
<VerticalStackLayout Padding="10"> | ||
<CollectionView | ||
ItemsSource="{Binding GroupedItems}" | ||
IsGrouped="true" | ||
CanReorderItems="true" | ||
CanMixGroups="false" | ||
AutomationId="CollectionViewControl"> | ||
<CollectionView.GroupHeaderTemplate> | ||
<DataTemplate> | ||
<Label Text="{Binding GroupHeaderName}" | ||
FontAttributes="Bold" | ||
FontSize="14" | ||
Padding="5"/> | ||
</DataTemplate> | ||
</CollectionView.GroupHeaderTemplate> | ||
<CollectionView.ItemTemplate> | ||
<DataTemplate> | ||
<Label Text="{Binding Name}" | ||
AutomationId="{Binding .}" | ||
FontSize="12" | ||
Padding="5"/> | ||
</DataTemplate> | ||
</CollectionView.ItemTemplate> | ||
</CollectionView> | ||
</VerticalStackLayout> | ||
|
||
</ContentPage> |
56 changes: 56 additions & 0 deletions
56
src/Controls/tests/TestCases.HostApp/Issues/Issue28530.xaml.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System.Collections.ObjectModel; | ||
using System.ComponentModel; | ||
|
||
namespace Maui.Controls.Sample.Issues; | ||
[Issue(IssueTracker.Github, 28530, "[Catalyst] CanMixGroups Set to False Still Allows Reordering Between Groups in CollectionView", PlatformAffected.macOS)] | ||
public partial class Issue28530 : ContentPage | ||
{ | ||
public Issue28530() | ||
{ | ||
InitializeComponent(); | ||
BindingContext = new Issue28530CollectionViewViewModel(); | ||
} | ||
} | ||
|
||
public class Issue28530CollectionViewViewModel : INotifyPropertyChanged | ||
{ | ||
public ObservableCollection<Issue28530GroupedItem> GroupedItems { get; set; } | ||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
public Issue28530CollectionViewViewModel() | ||
{ | ||
GroupedItems = new ObservableCollection<Issue28530GroupedItem> | ||
{ | ||
new Issue28530GroupedItem("Group 1") | ||
{ | ||
new Issue28530Item { Name = "Item 1" }, | ||
new Issue28530Item { Name = "Item 2" } | ||
}, | ||
new Issue28530GroupedItem("Group 2") | ||
{ | ||
new Issue28530Item { Name = "Item 3" }, | ||
new Issue28530Item { Name = "Item 4" } | ||
} | ||
}; | ||
} | ||
|
||
protected void OnPropertyChanged(string propertyName) | ||
{ | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
} | ||
|
||
public class Issue28530GroupedItem : ObservableCollection<Issue28530Item> | ||
{ | ||
public string GroupHeaderName { get; set; } | ||
|
||
public Issue28530GroupedItem(string groupHeaderName) | ||
{ | ||
GroupHeaderName = groupHeaderName; | ||
} | ||
} | ||
|
||
public class Issue28530Item | ||
{ | ||
public string Name { get; set; } | ||
} |
Binary file added
BIN
+9.67 KB
...sts/snapshots/mac/ReorderBetweenGroupsShouldNotOccurWhenCanMixGroupsIsFalse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28530.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#if TEST_FAILS_ON_WINDOWS | ||
// https://github.com/dotnet/maui/issues/13027 In windows, .NET MAUI CollectionView does not reorder when grouped | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
public class Issue28530 : _IssuesUITest | ||
{ | ||
public Issue28530(TestDevice device) : base(device) { } | ||
|
||
public override string Issue => "[Catalyst] CanMixGroups Set to False Still Allows Reordering Between Groups in CollectionView"; | ||
|
||
[Test] | ||
[Category(UITestCategories.CollectionView)] | ||
public void ReorderBetweenGroupsShouldNotOccurWhenCanMixGroupsIsFalse() | ||
{ | ||
App.WaitForElement("CollectionViewControl"); | ||
App.DragAndDrop("Item 2", "Item 3"); | ||
VerifyScreenshot(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have resaved the iOS image from CI. Could you please verify it now? @jsuarezruiz |
||
} | ||
} | ||
#endif |
Binary file added
BIN
+15 KB
...sts/snapshots/ios/ReorderBetweenGroupsShouldNotOccurWhenCanMixGroupsIsFalse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending snapshot on some platforms.
For example, Android:

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have committed the pending images for other platforms. @jsuarezruiz