xamarin / XamarinCommunityToolkit

The Xamarin Community Toolkit is a collection of Animations, Behaviors, Converters, and Effects for mobile development with Xamarin.Forms. It simplifies and demonstrates common developer tasks building iOS, Android, and UWP apps with Xamarin.Forms.
MIT License
1.59k stars 471 forks source link

[Bug] Entries inside TabView with HorizontalTextAlignment set to Center or End when clicked change TabView selection to first index on Android #776

Open meJevin opened 3 years ago

meJevin commented 3 years ago

Description

In my Xamarin.Forms project I have a MainPage (Content page inside of a Navigation page) which has a grid with a TabView.

TabView is populated with TabViewItems, containing a ContentView inside.

In those ContentViews I have a few Entry controls with HorizontalTextAlignment set to Center (or End).

When I am inside of, say, TabItemView with index != 0, and I click on those entries, TabView for some reason switches to the first TabViewItem.

Interestingly, when HorizontalTextAlignment is set to Start (which is default) this problem does not occur.

Steps to Reproduce

Described above.

Expected Behavior

I am able to interact with Entries with HorizontalTextAlignment != Start inside of TabView without switching back to the first TabItemView

Actual Behavior

Described in first section

Basic Information

waltersh790824 commented 3 years ago

Can confirm. I have a standard picker inside of a tabview showing the same behavior. Similar environment except no Refractored.MvvmHelpers 1.6.2

Kapusch commented 3 years ago

I've just noticed the same described behaviour on Android, with the last release of XCT. And as soon as I update the HorizontalTextAlignment to Start, it works.

KPHIBYE commented 3 years ago

I am experiencing the same behavior and created a minimal example project in hope to aid the resolving of this bug. It would be great if someone could verify the bug as it is still unverified. Edit: The bug also seems to appear when using a Picker Edit 2: This bug seems to come from the Xamarin.Forms CarouselView that TabView uses internally. See this Issue in the Xamarin.Forms repository.

meJevin commented 3 years ago

@justforfun-98, @Kapusch, @jsuarezruiz, @waltersh790824.

Update: this is actually a deeper issue. I've tested this on Android in Xamarin.Forms.

The issue is with CarouselView. When CarouselView has an Entry with HorizontalTetxAlignment set to something other than Start, upon focus it does something really weird to CarouselView, which causes it to spin out of control and scrolls to start.

No idea what's going on.

meJevin commented 3 years ago

@jsuarezruiz, I'll provide a reproduction project shortly.

esamk commented 3 years ago

Any news on this?

QTech-Pete commented 2 years ago

Anyone know when this will be fixed?