Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabBar selection indicator does not move to selected item when using ItemsSource #515

Closed
kazo0 opened this issue Mar 19, 2023 · 0 comments · Fixed by #516
Closed

TabBar selection indicator does not move to selected item when using ItemsSource #515

kazo0 opened this issue Mar 19, 2023 · 0 comments · Fixed by #516
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.

Comments

@kazo0
Copy link
Contributor

kazo0 commented Mar 19, 2023

When setting the ItemsSource property on the TabBar to a simple list of strings instead of creating the TabBarItem container explicitly, the selection indicator does not properly update to the currently selected item, it just stays stuck at the first item in the list

DataContext:

public List<string> Items => new List<string> { "Tab 1", "Tab 2", "Tab 3" };

XAML:

<utu:TabBar SelectedIndex="2"
			Background="LightBlue"
			ItemsSource="{x:Bind Items}">
	<utu:TabBar.SelectionIndicatorContentTemplate>
		<DataTemplate>
			<Border Height="2"
					VerticalAlignment="Bottom"
					Background="Red" />
		</DataTemplate>
	</utu:TabBar.SelectionIndicatorContentTemplate>
</utu:TabBar>

Current Behavior

image

Expected Behavior

image

@kazo0 kazo0 added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant