dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.21k stars 1.75k forks source link

CarouselView Snaps Back to First Page When Entry with Center or End HorizontalTextAlignment is Focused #20357

Open osyyyS opened 9 months ago

osyyyS commented 9 months ago

Description

In my .NET MAUI application, I am experiencing an issue with the CarouselView when it contains Entries with HorizontalTextAlignment set to Center or End (works fine on Start) are focused, while not being on the first Page. It snaps back to the first page of the CarouselView as shown in these Videos:

HorizontalTextAlignment="End":

https://github.com/dotnet/maui/assets/78726017/07f42daf-0046-4733-b92c-78a96fb160c2

HorizontalTextAlignment="Center":

https://github.com/dotnet/maui/assets/78726017/bae0d2de-1f22-4a7e-9911-44bc4b2afc6a

HorizontalTextAlignment="Start" (expected behaviour):

https://github.com/dotnet/maui/assets/78726017/bba9cd1d-6e60-41f7-900d-a198efa2bf7e

Steps to Reproduce

  1. Create a CarouselView with multiple pages.
  2. Inside the CarouselView, add Entries with the HorizontalTextAlignment property set to Center or End.
  3. Run the application and navigate to the CarouselView.
  4. Swipe to any page other than the first.
  5. Tap on any Entry to focus it.

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 13.0 - API 33 (Emulator), Android 13.0 - API 33 (Local Device),

Did you find any workaround?

No response

Relevant log output

No response

osyyyS commented 5 months ago

I created a minimal repro here: https://github.com/K-O-Software-Solutions/maui-carousel-bug/ It contains a README with the steps to reproduce and a video exposing the issue.

joshayoung commented 3 months ago

Has anyone found any good workarounds for this issue?

osyyyS commented 3 months ago

@joshayoung Unfortunately not.

Zhanglirong-Winnie commented 3 months ago

This issue has been verified using Visual Studio 17.11.0 Preview 6.0(8.0.3 & 8.0.61). Can repro on Android platform.

SmartSquareAZ commented 1 month ago

Having same problem

philippposch commented 1 month ago

I ran into the same issue, are there any updates/workarounds?