This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Convert to using list of accessibility elements for iOS tab indexes #11077
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7606.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 7606, "[Bug] When a view appears it is not accessible via VoiceOver", | ||
PlatformAffected.iOS)] | ||
#if UITEST | ||
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github10000)] | ||
[NUnit.Framework.Category(UITestCategories.ManualReview)] | ||
[NUnit.Framework.Category(UITestCategories.Accessibility)] | ||
#endif | ||
public class Issue7606 : TestContentPage | ||
{ | ||
protected override void Init() | ||
{ | ||
Label visibilityLabel = new Label() | ||
{ | ||
Text = "Swipe right and I should be read by voice over.", | ||
IsVisible = false | ||
}; | ||
|
||
Content = new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Button() | ||
{ | ||
Text = "Click Me", | ||
Command = new Command(() => visibilityLabel.IsVisible = !visibilityLabel.IsVisible) | ||
}, | ||
visibilityLabel | ||
} | ||
}; | ||
} | ||
|
||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8613.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 8613, "[Bug] Accessibility, screenreader ignores or skips items in nested stacklayout", | ||
PlatformAffected.iOS)] | ||
#if UITEST | ||
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github10000)] | ||
[NUnit.Framework.Category(UITestCategories.ManualReview)] | ||
[NUnit.Framework.Category(UITestCategories.Accessibility)] | ||
#endif | ||
public class Issue8613 : TestContentPage | ||
{ | ||
Label CreateLabel(bool? IsInAccessibleTree, string text) | ||
{ | ||
Label label = new Label() | ||
{ | ||
Text = text | ||
}; | ||
|
||
if(IsInAccessibleTree.HasValue) | ||
AutomationProperties.SetIsInAccessibleTree(label, IsInAccessibleTree); | ||
|
||
return label; | ||
} | ||
|
||
Entry CreateEntry(bool IsInAccessibleTree, string placeholderText) | ||
{ | ||
Entry entry = new Entry() | ||
{ | ||
Placeholder = placeholderText | ||
}; | ||
|
||
AutomationProperties.SetIsInAccessibleTree(entry, IsInAccessibleTree); | ||
return entry; | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
// Based on Sample | ||
// https://github.com/xamarin/xamarin-forms-samples/blob/master/UserInterface/Accessibility/Accessibility/AccessibilityPage.xaml | ||
Content = new ScrollView() | ||
{ | ||
Content = | ||
new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
CreateLabel(true, "Voice Over Swiping should progress sequentially through all visible elements"), | ||
CreateLabel(true, "Second Label IsInAccessibleTree = true"), | ||
new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Label() | ||
{ | ||
Text = "Enter Your Name: ", | ||
}, | ||
CreateEntry(true, "If Voice Over swiping gets stuck here test has failed"), | ||
}, | ||
}, | ||
CreateLabel(true, "Label After the Entry") | ||
}, | ||
}, | ||
}; | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8691.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 8691, "[Bug] TabIndex is ignored for first element on page for VoiceOver", | ||
PlatformAffected.iOS)] | ||
#if UITEST | ||
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github10000)] | ||
[NUnit.Framework.Category(UITestCategories.ManualReview)] | ||
[NUnit.Framework.Category(UITestCategories.Accessibility)] | ||
#endif | ||
public class Issue8691 : TestContentPage | ||
{ | ||
protected override void Init() | ||
{ | ||
|
||
Content = new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Label() | ||
{ | ||
Text = "2nd TabIndex", | ||
TabIndex = 20 | ||
}, | ||
new Label() | ||
{ | ||
Text = "I should be the first element focused when voice over is on", | ||
TabIndex = 10 | ||
}, | ||
new Label() | ||
{ | ||
Text = "3rd TabIndex", | ||
TabIndex = 30 | ||
}, | ||
} | ||
}; | ||
} | ||
|
||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue9137.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 9137, "A11y: Image in a11y tree stops voiceover from hopping to the next element", | ||
PlatformAffected.iOS)] | ||
#if UITEST | ||
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github10000)] | ||
[NUnit.Framework.Category(UITestCategories.ManualReview)] | ||
[NUnit.Framework.Category(UITestCategories.Accessibility)] | ||
#endif | ||
public class Issue9137 : TestContentPage | ||
{ | ||
Label CreateLabel(bool IsInAccessibleTree, string text) | ||
{ | ||
Label label = new Label() | ||
{ | ||
Text = text | ||
}; | ||
AutomationProperties.SetIsInAccessibleTree(label, IsInAccessibleTree); | ||
return label; | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
Content = new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
CreateLabel(false, "IsInAccessibleTree is false") | ||
}, | ||
}, | ||
new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Label() | ||
{ | ||
Text = "Turn Voice Over on and verify that you can swipe all the way forward and then backwards. If you get stuck toggling between the same two elements test has failed", | ||
TabIndex = 10 | ||
}, | ||
new Image() | ||
{ | ||
TabIndex = 20, | ||
Source = "coffee.png" | ||
}, | ||
}, | ||
}, | ||
new Label() | ||
{ | ||
Text = "Tab Index 70", | ||
TabIndex = 70 | ||
} | ||
}, | ||
}, | ||
} | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation for this property says the default is
null
https://developer.apple.com/documentation/objectivec/nsobject/1615147-accessibilityelements
When I do that it seems like the accessibility just returns to the default behavior. I added all the repro's from the PR listed here #9702 and I tested the Accessibility demo on xamarin-samples.
We might need to add the setAccessibilityElements side of this as well for certain edge cases.
For now we'll keep it simple and see if that works