xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.63k stars 1.87k forks source link

Accessibility issues when AccessibilityElements are updated while VoiceOver have already get some data #10425

Open jlemanbeto opened 4 years ago

jlemanbeto commented 4 years ago

Hello Xamarin.Forms Team,

First of all, sorry for my bad english abilities. I'm facing lock on random element using VoiceOver swipe when some elements visibility is updated by network events for exemple. So I've check PageContent.cs where are VoiceOver accessibilities functions. And I share you my thinking on some lines :

1) https://github.com/xamarin/Xamarin.Forms/blob/5a96f79252125705a50e12fce7bcb1125f52cf15/Xamarin.Forms.Platform.iOS/Renderers/PageContainer.cs#L69 Expected value seems to be nil (https://developer.apple.com/documentation/objectivec/nsobject/1615084-accessibilityelementatindex?language=objc) but seems that NSNull.Null isn't nil (https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/NumbersandValues/Articles/Null.html)

2) https://github.com/xamarin/Xamarin.Forms/blob/5a96f79252125705a50e12fce7bcb1125f52cf15/Xamarin.Forms.Platform.iOS/Renderers/PageContainer.cs#L72 If index is out of bound a System.ArgumentOutOfRangeException isn't supposed to be thown ?

3) https://github.com/xamarin/Xamarin.Forms/blob/5a96f79252125705a50e12fce7bcb1125f52cf15/Xamarin.Forms.Platform.iOS/Renderers/PageContainer.cs#L77 The return type should be a nint regarding the next points.

4) https://github.com/xamarin/Xamarin.Forms/blob/5a96f79252125705a50e12fce7bcb1125f52cf15/Xamarin.Forms.Platform.iOS/Renderers/PageContainer.cs#L80 Expected value seems be NSNotFound (https://developer.apple.com/documentation/objectivec/nsobject/1615078-indexofaccessibilityelement?language=objc) that is more like nint.MaxValue than int.MaxValue.

5) https://github.com/xamarin/Xamarin.Forms/blob/5a96f79252125705a50e12fce7bcb1125f52cf15/Xamarin.Forms.Platform.iOS/Renderers/PageContainer.cs#L83 If element doesn't exists in the List IndexOf seems to return -1 (https://docs.microsoft.com/fr-fr/dotnet/api/system.collections.generic.list-1.indexof?view=netframework-4.8) that is not so close to NSNotFound.

Thanks for reading Thanks in advance for your feedbacks

Best Regards,

Jean

jpauly-pe commented 3 years ago

Hi XF team,

I saw this issue was added in the 5.0.0 milestone, but removed from it in november.

Is this issue already solved ? If not, were you able to reproduce ?

Thanks.