This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Commit 016206d
authored
Support accessibility back gesture to pop route from view controller (#51241)
Adapted suggestion from flutter/flutter#74246 (comment) to pop the route if the view controller route if `accessibilityPerformEscape` is called at that level in the responder chain.
Ideally this could know if the route was successfully popped, and only then return `YES` (halting propagation through the responder chain).
I confirmed by editing https://docs.flutter.dev/cookbook/navigation/navigation-basics#interactive-example as a demo that that the two-finger scrub (move two fingers back and forth three times quickly, making a "z") navigates back to the last route, and that the [`SementicObject`](https://github.com/flutter/engine/blob/88882292c952d76069cee67d76acc0fbae51c749/shell/platform/darwin/ios/framework/Source/SemanticsObject.mm#L763) scrub, which already worked, continued to work.
I'm not super familiar with this code, hopefully there aren't further gotchas I'm not thinking of.
Fixes flutter/flutter#74246
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style1 parent ad75e93 commit 016206d
File tree
4 files changed
+26
-5
lines changed- shell/platform/darwin/ios/framework/Source
- testing/ios/IosUnitTests
- IosUnitTests.xcodeproj
- Tests
4 files changed
+26
-5
lines changedLines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2104 | 2104 | | |
2105 | 2105 | | |
2106 | 2106 | | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
2107 | 2116 | | |
2108 | 2117 | | |
2109 | 2118 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1365 | 1365 | | |
1366 | 1366 | | |
1367 | 1367 | | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
1368 | 1384 | | |
1369 | 1385 | | |
1370 | 1386 | | |
| |||
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
| |||
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
75 | | - | |
76 | 74 | | |
77 | 75 | | |
78 | 76 | | |
| |||
109 | 107 | | |
110 | 108 | | |
111 | 109 | | |
112 | | - | |
113 | 110 | | |
114 | 111 | | |
115 | 112 | | |
116 | 113 | | |
117 | | - | |
118 | 114 | | |
119 | 115 | | |
120 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
0 commit comments