Skip to content

Commit 3b8f78f

Browse files
authored
[net10.0] Merge main to net10 (#29720)
### Description of Change Bring latest changes from main to net10.0 branch
2 parents fe48e2c + 53bda7b commit 3b8f78f

File tree

15 files changed

+309
-9
lines changed

15 files changed

+309
-9
lines changed

eng/Versions.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<!-- Samsung/Tizen.NET -->
6464
<SamsungTizenSdkPackageVersion>8.0.148</SamsungTizenSdkPackageVersion>
6565
<!-- wasdk -->
66-
<MicrosoftWindowsAppSDKPackageVersion>1.7.250401001</MicrosoftWindowsAppSDKPackageVersion>
66+
<MicrosoftWindowsAppSDKPackageVersion>1.7.250513003</MicrosoftWindowsAppSDKPackageVersion>
6767
<MicrosoftWindowsSDKBuildToolsPackageVersion>10.0.22621.756</MicrosoftWindowsSDKBuildToolsPackageVersion>
6868
<MicrosoftGraphicsWin2DPackageVersion>1.3.2</MicrosoftGraphicsWin2DPackageVersion>
6969
<MicrosoftWindowsWebView2PackageVersion>1.0.3179.45</MicrosoftWindowsWebView2PackageVersion>
@@ -82,7 +82,7 @@
8282
<MicrosoftAspNetCoreMetadataPackageVersion>10.0.0-preview.5.25277.114</MicrosoftAspNetCoreMetadataPackageVersion>
8383
<MicrosoftJSInteropPackageVersion>10.0.0-preview.5.25277.114</MicrosoftJSInteropPackageVersion>
8484
<!-- Everything else (previous edition) -->
85-
<MicrosoftAspNetCorePackageVersion>8.0.10</MicrosoftAspNetCorePackageVersion>
85+
<MicrosoftAspNetCorePackageVersion>8.0.16</MicrosoftAspNetCorePackageVersion>
8686
<MicrosoftAspNetCoreAuthorizationPreviousPackageVersion>$(MicrosoftAspNetCorePackageVersion)</MicrosoftAspNetCoreAuthorizationPreviousPackageVersion>
8787
<MicrosoftAspNetCoreAuthenticationFacebookPreviousPackageVersion>$(MicrosoftAspNetCorePackageVersion)</MicrosoftAspNetCoreAuthenticationFacebookPreviousPackageVersion>
8888
<MicrosoftAspNetCoreAuthenticationGooglePreviousPackageVersion>$(MicrosoftAspNetCorePackageVersion)</MicrosoftAspNetCoreAuthenticationGooglePreviousPackageVersion>

src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void OnItemsVectorChanged(global::Windows.Foundation.Collections.IObservableVect
149149
{
150150
var lastItem = items[itemsCount - 1];
151151
// Adjusts the scroll offset to keep the last item in the list displayed when new items are added.
152-
ListViewBase.ScrollIntoView(lastItem);
152+
ListViewBase.ScrollIntoView(lastItem, ScrollIntoViewAlignment.Leading);
153153
}
154154
}
155155

src/Controls/src/Core/Page/Page.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,6 @@ protected virtual void OnAppearing()
488488
/// <remarks>
489489
/// <para>Application developers can override this method to provide behavior when the back button is pressed.
490490
/// When overridden to handle or cancel the navigation yourself, this method should return <see langword="true"/>.</para>
491-
/// <para>This only works on Android and UWP for the hardware back button. On iOS, this method will never be called because there is no hardware back button.</para>
492491
/// </remarks>
493492
protected virtual bool OnBackButtonPressed()
494493
{
7.98 KB
Loading
48.9 KB
Loading
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
using Microsoft.Maui.Controls;
2+
3+
namespace Maui.Controls.Sample.Issues
4+
{
5+
[Issue(IssueTracker.Github, 19465, "Double tap gesture NullReferenceException when navigating", PlatformAffected.Android)]
6+
public class Issue19465 : NavigationPage
7+
{
8+
public Issue19465() : base(new Issue19465Content())
9+
{
10+
}
11+
12+
public class Issue19465Content : ContentPage
13+
{
14+
public Issue19465Content()
15+
{
16+
var layout = new StackLayout();
17+
18+
var button = new Button
19+
{
20+
AutomationId = "FirstButton",
21+
Text = "Navigate"
22+
};
23+
24+
button.Clicked += OnNavigateClicked;
25+
26+
layout.Children.Add(button);
27+
Content = layout;
28+
}
29+
30+
async void OnNavigateClicked(object sender, System.EventArgs e)
31+
{
32+
await Navigation.PushAsync(new Issue19465SecondPage());
33+
}
34+
}
35+
}
36+
37+
internal class Issue19465SecondPage : ContentPage
38+
{
39+
public Issue19465SecondPage()
40+
{
41+
var layout = new StackLayout();
42+
var tapGestureRecognizer = new TapGestureRecognizer();
43+
tapGestureRecognizer.Tapped += OnTapGestureRecognizerTapped;
44+
tapGestureRecognizer.NumberOfTapsRequired = 2;
45+
46+
layout.GestureRecognizers.Add(tapGestureRecognizer);
47+
var label = new Label
48+
{
49+
AutomationId = "SecondLabel",
50+
Text = "Double Tap"
51+
};
52+
53+
layout.Children.Add(label);
54+
Content = layout;
55+
}
56+
57+
async void OnTapGestureRecognizerTapped(object sender, TappedEventArgs e)
58+
{
59+
Navigation.InsertPageBefore(new Issue19465ThirdPage(), this);
60+
await Navigation.PopAsync(animated: false);
61+
}
62+
}
63+
64+
internal class Issue19465ThirdPage : ContentPage
65+
{
66+
public Issue19465ThirdPage()
67+
{
68+
var layout = new StackLayout();
69+
70+
var button = new Button
71+
{
72+
AutomationId = "ThirdButton",
73+
Text = "Navigate Back"
74+
};
75+
76+
button.Clicked += OnNavigateClicked;
77+
78+
layout.Children.Add(button);
79+
Content = layout;
80+
}
81+
82+
async void OnNavigateClicked(object sender, System.EventArgs e)
83+
{
84+
await Navigation.PopAsync();
85+
}
86+
}
87+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
namespace Maui.Controls.Sample.Issues
2+
{
3+
[Issue(IssueTracker.Github, 24930, "The picker allows you to write text if the keyboard is visible", PlatformAffected.Android)]
4+
public partial class Issue24930 : ContentPage
5+
{
6+
const string FirstPickerItem = "Baboon";
7+
const string PickerId = "picker";
8+
public Issue24930()
9+
{
10+
Picker picker = new Picker
11+
{
12+
AutomationId = PickerId,
13+
Title = "Select a monkey"
14+
};
15+
16+
17+
picker.ItemsSource = new List<string>
18+
{
19+
FirstPickerItem,
20+
"Capuchin Monkey"
21+
};
22+
23+
Content = new StackLayout()
24+
{
25+
Children = { picker }
26+
};
27+
}
28+
}
29+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
using System.Collections.ObjectModel;
2+
3+
namespace Maui.Controls.Sample.Issues;
4+
[Issue(IssueTracker.Github, 29207, "KeepLastItemInView Does Not Scroll to Last Item When Adding Items at Top, Instead Scrolls to SecondLast Item", PlatformAffected.UWP)]
5+
public class Issue29207 : ContentPage
6+
{
7+
Issue29207_ItemsViewModel viewModel;
8+
9+
public Issue29207()
10+
{
11+
viewModel = new Issue29207_ItemsViewModel();
12+
BindingContext = viewModel;
13+
14+
CollectionView collectionView = new CollectionView
15+
{
16+
ItemsSource = viewModel.ItemsSource,
17+
ItemsUpdatingScrollMode = ItemsUpdatingScrollMode.KeepLastItemInView,
18+
ItemTemplate = new DataTemplate(() =>
19+
{
20+
var label = new Label
21+
{
22+
FontSize = 20,
23+
Padding = 10
24+
};
25+
label.SetBinding(Label.TextProperty, ".");
26+
return label;
27+
})
28+
};
29+
30+
var addButton = new Button
31+
{
32+
Text = "Add",
33+
WidthRequest = 120,
34+
AutomationId = "InsertItemButton"
35+
};
36+
addButton.Clicked += Button_Clicked_1;
37+
38+
var buttonLayout = new HorizontalStackLayout
39+
{
40+
Padding = 40,
41+
Spacing = 40,
42+
Children = { addButton }
43+
};
44+
45+
var grid = new Grid
46+
{
47+
RowDefinitions =
48+
{
49+
new RowDefinition { Height = GridLength.Auto },
50+
new RowDefinition { Height = GridLength.Star }
51+
}
52+
};
53+
54+
grid.Add(buttonLayout, 0, 0);
55+
grid.Add(collectionView, 0, 1);
56+
57+
Content = grid;
58+
}
59+
60+
void Button_Clicked_1(object sender, EventArgs e)
61+
{
62+
viewModel.ItemsSource.Insert(0, $"NewItem");
63+
}
64+
}
65+
66+
public class Issue29207_ItemsViewModel
67+
{
68+
public ObservableCollection<string> ItemsSource = new ObservableCollection<string>();
69+
70+
public Issue29207_ItemsViewModel()
71+
{
72+
for (int i = 0; i < 20; i++)
73+
{
74+
ItemsSource.Add($"Item {i}");
75+
}
76+
}
77+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using NUnit.Framework;
2+
using UITest.Appium;
3+
using UITest.Core;
4+
5+
namespace Microsoft.Maui.TestCases.Tests.Issues
6+
{
7+
public class Issue19465 : _IssuesUITest
8+
{
9+
public Issue19465(TestDevice device)
10+
: base(device)
11+
{ }
12+
13+
public override string Issue => "Double tap gesture NullReferenceException when navigating";
14+
15+
[Test]
16+
[Category(UITestCategories.Gestures)]
17+
public void Issue19465Test()
18+
{
19+
// 1. Navigate to a second page.
20+
App.WaitForElement("FirstButton");
21+
App.Tap("FirstButton");
22+
23+
// 2. Double tap (gesture) a Label to navigate again.
24+
// Without exceptions, the test already passed.
25+
App.WaitForElement("SecondLabel");
26+
App.DoubleTap("SecondLabel");
27+
28+
// 3. Navigate back.
29+
App.WaitForElement("ThirdButton");
30+
App.DoubleTap("ThirdButton");
31+
App.Back();
32+
}
33+
}
34+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#if ANDROID // This test is only for Android, Since the edit text is base view for Picker in Android
2+
using NUnit.Framework;
3+
using UITest.Appium;
4+
using UITest.Core;
5+
namespace Microsoft.Maui.TestCases.Tests.Issues
6+
{
7+
public class Issue24930 : _IssuesUITest
8+
{
9+
const string FirstPickerItem = "Baboon";
10+
const string PickerId = "picker";
11+
12+
public Issue24930(TestDevice device) : base(device) { }
13+
14+
public override string Issue => "The picker allows you to write text if the keyboard is visible";
15+
16+
// Key codes for "abcd"
17+
int[] keyCodes = new int[]
18+
{
19+
29,30,31,32
20+
};
21+
22+
[Test]
23+
[Category(UITestCategories.Picker)]
24+
public void PickerShouldNotAllowUserInputThroughKeyboard()
25+
{
26+
App.WaitForElement(PickerId);
27+
App.Tap(PickerId);
28+
App.WaitForElement(FirstPickerItem);
29+
App.Back();
30+
foreach (var keyCode in keyCodes)
31+
{
32+
App.SendKeys(keyCode);
33+
}
34+
35+
VerifyScreenshot();
36+
}
37+
38+
}
39+
}
40+
#endif

0 commit comments

Comments
 (0)