Skip to content

Commit

Permalink
feat: added inputextensions returntype property
Browse files Browse the repository at this point in the history
  • Loading branch information
rajamatt committed May 10, 2024
2 parents cef56d6 + 1dd4b2c commit fa8cfc7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/Uno.Toolkit.RuntimeTests/Tests/TabBarTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@ public async Task SetSelectedItem()
Assert.IsTrue(source[1].IsSelected);
}

[TestMethod]
public async Task SetSelectedItem_SimpleSource()
{
var source = Enumerable.Range(0, 3).ToArray();
var SUT = new TabBar
{
ItemsSource = source,
SelectedItem = 1,
};

await UnitTestUIContentHelperEx.SetContentAndWait(SUT);

Assert.AreEqual(source[1], SUT.SelectedItem);
Assert.AreEqual(1, SUT.SelectedIndex);
}

[TestMethod]
public async Task SetSelectedIndex()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Uno.Toolkit.UI/Controls/TabBar/TabBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private void OnSelectedItemChanged(DependencyPropertyChangedEventArgs? args)
return;
}

var newlySelectedItem = SelectedItem as TabBarItem;
var newlySelectedItem = this.FindContainer<TabBarItem>(SelectedItem);
if (!IsReady && newlySelectedItem != null)
{
return;
Expand Down

0 comments on commit fa8cfc7

Please sign in to comment.