Unable to programmatically scroll elements into view (using .ScrollToAsync()) if they're behind an open picker view AND they're towards the bottom of the page.
However, scrolling them into view is possible to do manually with touch gestures.
Steps to Reproduce
Create a scrollview. In the scrollview, add a picker & an element at the very bottom of the page.
For picker's SelectedIndexChanged, try to scroll the bottom element into view.
Open picker & change selected item.
Expected Behavior
Page should scroll the bottom element into view above the open picker view.
Actual Behavior
Element stays at the bottom of the page behind the picker view.
Basic Information
Version with issue: 5.0.0.2545
Last known good version: N/A
Platform Target Frameworks:
iOS: XCode 14.2
Android: N/A
UWP: N/A
Android Support Library / AndroidX Version: N/A
NuGet Packages: N/A
Affected Devices: Tested on iPhone 14 Pro & iPhone SE (3rd Gen) both iOS 16.2
using System;
using Xamarin.Forms;
namespace MyApp
{
public partial class HomePage : ContentPage
{
public HomePage()
{
InitializeComponent();
NavigationPage.SetHasNavigationBar(this, false);
}
async void Picker_SelectedIndexChanged(System.Object sender, System.EventArgs e)
{
await mainScrollView.ScrollToAsync(showMe_Button, ScrollToPosition.End, true);
}
}
}
PageModel
using System;
using System.Collections.ObjectModel;
namespace MyApp
{
public class TestItem
{
public string Name { get; set; }
public TestItem()
{
}
}
public class HomePageModel : FreshMvvm.FreshBasePageModel
{
public ObservableCollection<TestItem> TestList { get; set; }
public HomePageModel()
{
TestList = new()
{
new() { Name = "Item 1" },
new() { Name = "Item 2" },
new() { Name = "Item 3" },
};
}
}
}
Description
Unable to programmatically scroll elements into view (using .ScrollToAsync()) if they're behind an open picker view AND they're towards the bottom of the page. However, scrolling them into view is possible to do manually with touch gestures.
Steps to Reproduce
Expected Behavior
Page should scroll the bottom element into view above the open picker view.
Actual Behavior
Element stays at the bottom of the page behind the picker view.
Basic Information
Screen-records
Programatic scrolling not working on changing the picker selection https://user-images.githubusercontent.com/40665312/213464980-8f71ba8d-70ef-4660-b668-49a51050ef83.mp4
Manual scrolling working by touching the screen https://user-images.githubusercontent.com/40665312/213464743-01051b95-933e-4ac8-9a37-7c1b9c66c59a.mp4
Code to recreate