Skip to content
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

ScrollView.ScrollToAsync doesn't work when called from Page.OnAppearing - fix #26796

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Dec 24, 2024

Issues Fixed

Fixes #26781

<Grid RowDefinitions="*,*">
    <ScrollView x:Name="scrollView">

        <VerticalStackLayout>
            <Label Text="This is a scroll view scrolled to the bottom button"
                    HeightRequest="500"/>
            <Button x:Name="BottomButton"
                    AutomationId="successButton"
                    Text="Success if visible"/>
        </VerticalStackLayout>
    </ScrollView>
    <ScrollView Grid.Row="1"
                x:Name="scrollView2">
        <VerticalStackLayout>
            <Label Text="This is a scroll view scrolled to y pos"
                    HeightRequest="500"/>
            <Label AutomationId="successLabel"
                    Text="Success if visible"/>
        </VerticalStackLayout>
    </ScrollView>
</Grid>
protected override async void OnAppearing()
{
	await scrollView.ScrollToAsync(BottomButton, ScrollToPosition.MakeVisible, true);
	await scrollView2.ScrollToAsync(0, 600, true);
}
Android iOS
Screen.Recording.2024-12-24.at.01.51.23.mov
Untitled.mp4

@kubaflo kubaflo requested a review from a team as a code owner December 24, 2024 02:01
Copy link
Contributor

Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ScrollView.ScrollToAsync doesn't work when called from Page.OnAppearing
1 participant