docs-maui
docs-maui copied to clipboard
.NET MAUI CollectionView Item is not read by screen readers
Description
Document this https://github.com/dotnet/docs-maui/issues/2753#issuecomment-2619332838
This issue has been moved from a ticket on Developer Community.
[severity:It bothers me. A fix would be nice] In MAUI technology on WINDOWS when I create a CollectionView like this
<CollectionView
x:Name="cv"
ItemsSource="{ Binding categories, Mode=TwoWay}"
SelectedItem="{Binding selectedItem}"
SelectionMode="Single"
>
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid
RowDefinitions="auto,auto"
ColumnDefinitions="*"
Padding="0,2"
Margin="0,2"
>
<Label
Grid.Row="0"
Grid.Column="0"
Text="{Binding Title}"
LineBreakMode="TailTruncation"
MaxLines="1"
FontSize="16"
Padding="0"
Margin="0"
/>
<Label
Grid.Row="1"
Grid.Column="0"
Text="{Binding Description}"
LineBreakMode="TailTruncation"
MaxLines="1" Padding="0" Margin="0" /> </Grid> </DataTemplate> </CollectionView.ItemTemplate> </CollectionView>
And I am running the application on windows When I move between items on the list, the screen reader read this phrase Microsoft.Maui.Controls.Platform.ItemTemplateContext not selected 2 of 4 Although it is expected to read the content of this item, I do not know where the problem is or whether I did something wrong, but what I understand is that the .net maui technology on the Windows system requires Microsoft to take care of the accessibility of the items or the availability of the wonderful DataGridView instance found in Windows Forms
Original Comments
Feedback Bot on 9/19/2024, 06:52 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
@rachelkang The issue with CollectionView not working with screenreaders that I mentioned here: https://github.com/dotnet/maui/issues/20319#issuecomment-2455163375. Both are complete showstoppers from a compliance perspective.
Probably the same as https://github.com/dotnet/maui/issues/6803
Hello! You can fix this by adding SemanticProperties.Description on the Grid element in the DataTemplate:
<DataTemplate>
<Grid RowDefinitions="auto,auto"
ColumnDefinitions="*"
Padding="0,2"
Margin="0,2"
SemanticProperties.Description="{Binding Title}">
<Label Grid.Row="0"
Grid.Column="0"
Text="{Binding Title}"
LineBreakMode="TailTruncation"
MaxLines="1"
FontSize="16"
Padding="0"
Margin="0" />
</Grid>
</DataTemplate>