You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SR] Allow using control + shift + arrow keys for NVDA (#2257)
## Summary:
NVDA takes control of inputs in its default mode, so users can't use just the arrow keys to move the interactive elements on the graph. We want to allow using modifier key + control + shift + arrow keys to move interactive elements on the graph.
Note: This already works with the modifier key + shift + arrow keys (no control), but holding down shift makes it so that the amount the element moves is 4x more than without shift.
Note 2: When using NVDA, you can get the same keyboard experience as not using a screen reader (i.e. move the points with arrow keys only) if you go into focus mode (NVDA key + space bar).
Implemented:
- Added support for the control key press
- stops shift from increasing the move difference if control is held down
- Added "modifier key + control + shift +" to the instruction strings
Issue: https://khanacademy.atlassian.net/browse/LEMS-2874
## Test plan:
`yarn jest packages/perseus/src/widgets/interactive-graphs/interactive-graph.test.tsx`
Storybook
http://localhost:6006/?path=/docs/perseuseditor-widgets-interactive-graph--docs
Author: nishasy
Reviewers: SonicScrewdriver, mark-fitzgerald, catandthemachines
Required Reviewers:
Approved By: SonicScrewdriver
Checks: ✅ 8 checks were successful
Pull Request URL: #2257
Copy file name to clipboardExpand all lines: packages/perseus/src/strings.ts
+4-4
Original file line number
Diff line number
Diff line change
@@ -690,9 +690,9 @@ export const strings = {
690
690
// been finalized. Remove this comment after the tickets have been
691
691
// created.
692
692
srGraphInstructions:
693
-
"Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use the Arrow keys to move it.",
693
+
"Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use Control + Shift + Arrows to move it.",
694
694
srUnlimitedGraphInstructions:
695
-
"Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use the Arrow keys to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.",
695
+
"Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use Control + Shift + Arrows to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.",
696
696
xAxis: "X-axis",
697
697
yAxis: "Y-axis",
698
698
srPointAtCoordinates: "Point %(num)s at %(x)s comma %(y)s.",
// The following strings are used for interactive graph SR descriptions.
972
972
srGraphInstructions:
973
-
"Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use the Arrow keys to move it.",
973
+
"Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use Control + Shift + Arrows to move it.",
974
974
srUnlimitedGraphInstructions:
975
-
"Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use the Arrow keys to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.",
975
+
"Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use Control + Shift + Arrows to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.",
976
976
xAxis: "X-axis",
977
977
yAxis: "Y-axis",
978
978
graphKeyboardPrompt: "Press Shift + Enter to interact with the graph",
Copy file name to clipboardExpand all lines: packages/perseus/src/widgets/interactive-graphs/__snapshots__/interactive-graph.test.tsx.snap
+8-8
Original file line number
Diff line number
Diff line change
@@ -1118,7 +1118,7 @@ exports[`Interactive Graph question Should render predictably: after interaction
1118
1118
id="instructions-:r2:"
1119
1119
tabindex="-1"
1120
1120
>
1121
-
Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use the Arrow keys to move it.
1121
+
Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use Control + Shift + Arrows to move it.
1122
1122
</div>
1123
1123
<div
1124
1124
class="default_xu2jcg-o_O-inlineStyles_16155wj"
@@ -1559,7 +1559,7 @@ exports[`Interactive Graph question Should render predictably: after interaction
1559
1559
id="instructions-:ra:"
1560
1560
tabindex="-1"
1561
1561
>
1562
-
Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use the Arrow keys to move it.
1562
+
Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use Control + Shift + Arrows to move it.
1563
1563
</div>
1564
1564
<div
1565
1565
class="default_xu2jcg-o_O-inlineStyles_16155wj"
@@ -2006,7 +2006,7 @@ exports[`Interactive Graph question Should render predictably: after interaction
2006
2006
id="instructions-:rh:"
2007
2007
tabindex="-1"
2008
2008
>
2009
-
Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use the Arrow keys to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.
2009
+
Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use Control + Shift + Arrows to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.
2010
2010
</div>
2011
2011
<div
2012
2012
class="default_xu2jcg-o_O-inlineStyles_16155wj"
@@ -2258,7 +2258,7 @@ exports[`Interactive Graph question Should render predictably: after interaction
2258
2258
id="instructions-:rm:"
2259
2259
tabindex="-1"
2260
2260
>
2261
-
Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use the Arrow keys to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.
2261
+
Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use Control + Shift + Arrows to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.
2262
2262
</div>
2263
2263
<div
2264
2264
class="default_xu2jcg-o_O-inlineStyles_16155wj"
@@ -2502,7 +2502,7 @@ exports[`Interactive Graph question Should render predictably: first render 1`]
2502
2502
id="instructions-:r2:"
2503
2503
tabindex="-1"
2504
2504
>
2505
-
Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use the Arrow keys to move it.
2505
+
Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use Control + Shift + Arrows to move it.
2506
2506
</div>
2507
2507
<div
2508
2508
class="default_xu2jcg-o_O-inlineStyles_16155wj"
@@ -2943,7 +2943,7 @@ exports[`Interactive Graph question Should render predictably: first render 2`]
2943
2943
id="instructions-:ra:"
2944
2944
tabindex="-1"
2945
2945
>
2946
-
Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use the Arrow keys to move it.
2946
+
Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use Control + Shift + Arrows to move it.
2947
2947
</div>
2948
2948
<div
2949
2949
class="default_xu2jcg-o_O-inlineStyles_16155wj"
@@ -3390,7 +3390,7 @@ exports[`Interactive Graph question Should render predictably: first render 3`]
3390
3390
id="instructions-:rh:"
3391
3391
tabindex="-1"
3392
3392
>
3393
-
Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use the Arrow keys to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.
3393
+
Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use Control + Shift + Arrows to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.
3394
3394
</div>
3395
3395
<div
3396
3396
class="default_xu2jcg-o_O-inlineStyles_16155wj"
@@ -3642,7 +3642,7 @@ exports[`Interactive Graph question Should render predictably: first render 4`]
3642
3642
id="instructions-:rm:"
3643
3643
tabindex="-1"
3644
3644
>
3645
-
Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use the Arrow keys to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.
3645
+
Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use Control + Shift + Arrows to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.
"Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use the Arrow keys to move it.";
80
+
"Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use Control + Shift + Arrows to move it.";
81
81
constunlimitedInstructions=
82
-
"Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use the Arrow keys to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.";
82
+
"Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use Control + Shift + Arrows to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.";
0 commit comments