Skip to content

Commit

Permalink
chore: Properly have tbi container applied
Browse files Browse the repository at this point in the history
  • Loading branch information
eriklimakc committed Oct 11, 2024
1 parent 3628d17 commit 1c4ecec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/Uno.Toolkit.RuntimeTests/Tests/TabBarTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/Uno.Toolkit.UI/Controls/TabBar/TabBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1c4ecec

Please sign in to comment.