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 nests TabBarItems when being set as ItemTemplate's root #1129

Closed
kazo0 opened this issue May 9, 2024 · 5 comments · Fixed by #1261
Closed

TabBar nests TabBarItems when being set as ItemTemplate's root #1129

kazo0 opened this issue May 9, 2024 · 5 comments · Fixed by #1261
Assignees
Labels
control/tabbar kind/bug Something isn't working

Comments

@kazo0
Copy link
Contributor

kazo0 commented May 9, 2024

With the following XAML

<utu:TabBar SelectedIndex="3"
			ItemsSource="{Binding Data.Items}"
			Style="{StaticResource TopTabBarStyle}">
	<utu:TabBar.ItemTemplate>
		<DataTemplate>
			<utu:TabBarItem Background="Red" Content="Content" />
		</DataTemplate>
	</utu:TabBar.ItemTemplate>
</utu:TabBar>

We should be seeing this:

image

Instead, we are seeing that that TabBar now contains TabBarItems that contain the red TabBarItem as it's content:

image
@kazo0 kazo0 added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels May 9, 2024
@Xiaoy312
Copy link
Contributor

Xiaoy312 commented May 9, 2024

ChipGroup\Chip suffers the same problem

Both ChipGroup and TabBar inherits from ItemsControl, and both override GetContainerForItemOverride+IsItemItsOwnContainerOverride.
This handles the case where the Items or ItemsSource contains the proper type for its item "container". However, it does not support the case where the supposed "container" is coming from the result of ItemTemplate.

That said, ListView and ListViewItem works... both on Windows and Uno somehow...
On Uno, this is done via ItemsControl::GetRootOfItemTemplateAsContainer implemented in Selector.
It is unclear how Windows is handling this..?

@Xiaoy312 Xiaoy312 added control/tabbar and removed triage/untriaged Indicates an issue requires triaging or verification. labels Jul 26, 2024
@iurycarlos
Copy link
Contributor

iurycarlos commented Sep 24, 2024

Something similar at #1256

@kazo0
Copy link
Contributor Author

kazo0 commented Sep 30, 2024

@iurycarlos is this blocking for your work on the project? We may want to prioritize this one

@iurycarlos
Copy link
Contributor

iurycarlos commented Sep 30, 2024

It is blocking just a detail in UI.
I don't think it is crucial for first version, but would be nice to have it in the finished UI.

@jhanvi03
Copy link

@Darsh0307 Could you please verify?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
control/tabbar kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants