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

[Bug] TabIndex prevents scrolling on iOS when using three-fingered swipe with VoiceOver for accessibility #12456

Closed
johnshardman opened this issue Oct 12, 2020 · 4 comments

Comments

@johnshardman
Copy link

In code intended to run on Windows (UWP) as well as Android and iOS, it is likely that TabIndex will be used on controls in order to get the tab order wanted for Windows exactly correct. However, adding TabIndex on a View prevents a ScrollView containing that View from scrolling on iOS when using a three-fingered swipe with VoiceOver (accessibility).

On XF 4.8, the ScrollView in the following XAML does not scroll using a three-fingered swipe with VoiceOver on iOS:

<StackLayout BackgroundColor="Red" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
    <ScrollView BackgroundColor="Aqua" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
        <StackLayout>
            <Label Text="Hi" HeightRequest="1000" VerticalOptions="FillAndExpand" />
            <Label Text="Again" HeightRequest="1000" VerticalOptions="Center" />
            <Button Text="Press Me" TabIndex="24" VerticalOptions="End" />
        </StackLayout>
    </ScrollView>
</StackLayout>

Expected Behavior

The ScrollView should scroll when a three-fingered swipe is used with VoiceOver on iOS

Actual Behavior

The ScrollView does not scroll

Basic Information

  • Version with issue: XF 4.8
  • iOS: 14.0.1

Workaround

If defining UI in C# (rather than XAML), use an extension method rather than specify the TabIndex property. Have the extension method check the runtime platform and only set the TabIndex if the platform is not iOS (that way, TabIndex will work for UWP, WPF etc)

@johnshardman johnshardman added s/unverified New report that has yet to be verified t/bug 🐛 labels Oct 12, 2020
@rachelkang rachelkang added p/iOS 🍎 a/a11y 🔍 a/scrollview and removed s/unverified New report that has yet to be verified labels Oct 12, 2020
@rachelkang
Copy link
Contributor

duplicate of #11793 #11793

@johnshardman
Copy link
Author

This may be related to #11793 , but it's not clear that fixing #11793 would also fix this. I'd be tempted to leave this issue open as well, just in case...

@rachelkang
Copy link
Contributor

@johnshardman good point! The issues are very similar, but indeed not exactly the same

@rachelkang rachelkang reopened this Oct 12, 2020
@rachelkang
Copy link
Contributor

Hi, @johnshardman - as elaborated in dotnet/maui#1646 and https://devblogs.microsoft.com/xamarin/the-journey-to-accessible-apps-meaningful-content-ordering/, we no longer advise that TabIndex be used. Unfortunately, the property was long misunderstood and misused, and interfered with the accessibility of other controls as you've experienced with this issue.

Ideally, your app should not manipulate content ordering whatsoever - should you really need to, however, we recommend checking out SemanticOrderView from the XamarinCommunityToolkit, which has already proven to be a more accessible alternative.

If you haven't already, I also recommend updating to the latest version Xamarin.Forms or at least to Xamarin.Forms 5.0.0.2083, which has many accessibility improvements. These improvements include an experimental accessibility flag that addresses a lot of improvements in Android accessibility.

To leverage this flag on the latest versions of Xamarin Forms, the following code can be inserted in the App.xaml.cs file, following the InitializeComponent call and before the MainPage is set: Xamarin.Forms.Device.SetFlags(new List<string> { "Accessibility_Experimental"});

Let us know how that works for you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants