Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoy312 committed Oct 16, 2024
1 parent 475fef4 commit c4ff756
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/Uno.UI/Microsoft/UI/Xaml/Controls/TabView/TabView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,7 @@ ItemsPresenter GetItemsPresenter(ListView listView)

if (ReadLocalValue(SelectedItemProperty) != DependencyProperty.UnsetValue)
{
#if __IOS__
UpdateSelectedIndexFromSelectedItem();
#else
UpdateSelectedItem();
#endif
}
else
{
Expand Down
8 changes: 7 additions & 1 deletion src/Uno.UI/UI/Xaml/Controls/Primitives/Selector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,13 @@ internal virtual void OnSelectedItemChanged(object oldSelectedItem, object selec
#if !IS_UNIT_TESTS
if (newIndex != -1 && IsInLiveTree)
{
if (this is ListViewBase lvb)
if (this is ListViewBase lvb
#if __IOS__ // TODO@andres: verify if this is also needed for android
// workaround to prevent scrolling when it is not ready
// without this, the ios TabView could render blank if the selection happens too early.
&& ContainerFromIndex(newIndex) is FrameworkElement { IsLoaded: true }
#endif
)
{
#if __IOS__ || __ANDROID__
lvb.InstantScrollToIndex(newIndex);
Expand Down

0 comments on commit c4ff756

Please sign in to comment.