Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Spec] SemanticOrderView #1087

@PureWeen

Description

@PureWeen

SemanticOrderView

Currently TabIndex and IsTabStop are problematic APIs with Xamarin.Forms.
xamarin/Xamarin.Forms#13962 (comment)

Because we are not adding any new APIs to XF and .NET MAUI is still a few months out it would be useful if XCT could help provide a way for users to implement Focus Ordering

I have a basic implementation here
https://github.com/PureWeen/A11YTools/blob/main/A11YTools/A11YTools/Views/AccessibilityContentView.cs

That works for Android/iOS

Additional thoughts

  • My implementation on Android still needs to be tested with keyboard focus. That could be a second implementation though. Android has an additional set of APIs "nextFocus*" that are more relevant with keyboard navigation. iOS doesn't really have an equivalent
  • There is no UWP implementation. I'm assuming adding a UWP implementation should be easy :-)
  • If someone is able to make this work on iOS without having to wrap everything with another UIView then you will get all the gold stars
  • What's the best way to specify the ViewOrder? Can we do this in XAML somehow?

API

SemanticOrderView

Properties

API Description
[ViewOrder] This indicates the focus order of the controls when a user is navigating via TalkBack/VoiceOver

Scenarios

 <local:SemanticOrderView x:Name="acv">
    <StackLayout>
        <Label Text="First"
        VerticalOptions="CenterAndExpand" 
        HorizontalOptions="CenterAndExpand"
                x:Name="first">
        </Label>
        <CollectionView x:Name="third">
            <CollectionView.ItemTemplate>
                <DataTemplate>
                    <Label Text="{Binding .}"></Label>
                </DataTemplate>
            </CollectionView.ItemTemplate>
        </CollectionView>
        <Label Text="Second"
        VerticalOptions="CenterAndExpand" 
        HorizontalOptions="CenterAndExpand" 
                x:Name="second"/>
    </StackLayout>
</local:SemanticOrderView>
     acv.ViewOrder = new List<View> { first, second, third };

Platform Compatibility

  • Target Frameworks:
    • iOS:
    • Android:
    • UWP:

Backward Compatibility

Difficulty : [low/medium]

Metadata

Metadata

Labels

a11yIssue/PR has to do with accessibilityfeature-requestA request for a new feature.good-first-issueGood for newcomersin-progressActively being worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions