From 1c4ececde39a6a7f82de0a98e67e42297c0e91f5 Mon Sep 17 00:00:00 2001 From: eriklimakc Date: Fri, 11 Oct 2024 15:41:49 +0100 Subject: [PATCH] chore: Properly have tbi container applied --- src/Uno.Toolkit.RuntimeTests/Tests/TabBarTests.cs | 6 ++---- src/Uno.Toolkit.UI/Controls/TabBar/TabBar.cs | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Uno.Toolkit.RuntimeTests/Tests/TabBarTests.cs b/src/Uno.Toolkit.RuntimeTests/Tests/TabBarTests.cs index b99c1d32b..06d218027 100644 --- a/src/Uno.Toolkit.RuntimeTests/Tests/TabBarTests.cs +++ b/src/Uno.Toolkit.RuntimeTests/Tests/TabBarTests.cs @@ -445,11 +445,9 @@ public async Task Verify_ItemTemplated_Disabled_Not_Selectable() var SUT = new TabBar { - // If `ItemTemplate` is not set first then the order of - // `OnItemTemplateChanged` and `GetContainerForItemOverride` are not correct and test fail on android - ItemTemplate = dt, Style = (Style)Application.Current.Resources["TopTabBarStyle"], - ItemsSource = source + ItemsSource = source, + ItemTemplate = dt, }; await UnitTestUIContentHelperEx.SetContentAndWait(SUT); diff --git a/src/Uno.Toolkit.UI/Controls/TabBar/TabBar.cs b/src/Uno.Toolkit.UI/Controls/TabBar/TabBar.cs index ef7d62215..df31432ac 100644 --- a/src/Uno.Toolkit.UI/Controls/TabBar/TabBar.cs +++ b/src/Uno.Toolkit.UI/Controls/TabBar/TabBar.cs @@ -274,9 +274,8 @@ private void OnItemsSourceChanged() protected override void OnItemTemplateChanged(DataTemplate oldItemTemplate, DataTemplate newItemTemplate) { - base.OnItemTemplateChanged(oldItemTemplate, newItemTemplate); - IsUsingOwnContainerAsTemplateRoot = IsItemItsOwnContainerOverride(newItemTemplate?.LoadContent()); + base.OnItemTemplateChanged(oldItemTemplate, newItemTemplate); } private void OnSelectedItemChanged(DependencyPropertyChangedEventArgs? args)