Commit 66a3e8a
authored
feat(router-outlet): add swipeGesture prop to control swipe-to-go-back per outlet (#31055)
Issue number: resolves internal
---------
## What is the current behavior?
The swipe-to-go-back gesture on ion-router-outlet is controlled
differently across frameworks:
- React and Vue check the `swipeBackEnabled` config option on every
swipe attempt in their framework wrappers (`StackManager.canStart()` and
`IonRouterOutlet.canStart()`)
- Angular reads the config once at mount and controls the gesture
through its directive's `swipeGesture` setter
- There is no public, per-outlet property to enable or disable the
gesture. The only mechanism is the global `swipeBackEnabled` config
option
## What is the new behavior?
`ion-router-outlet` now exposes a public `swipeGesture` property in core
that controls the swipe-to-go-back gesture per outlet instance. It
defaults to true in "ios" mode and false in "md" mode, matching existing
behavior.
- The `swipeBackEnabled` config is read once when the outlet mounts (as
the default for `swipeGesture`) rather than checked on every swipe
attempt
- The config check has been removed from React's StackManager and Vue's
IonRouterOutlet -- core now owns this state
- Angular's directive forwards the value to the core component's
`swipeGesture` property for consistency
- Apps can disable the gesture on a specific outlet: `<IonRouterOutlet
swipeGesture={false} />`
- Apps that set `swipeBackEnabled` once at startup require no changes
## Does this introduce a breaking change?
- [X] Yes
- [ ] No
## Other information
I tried to align the updates to the BREAKING.md documents with the RR6
PR's changes to it to prevent issues from merging as much as possible1 parent 9c0bcb3 commit 66a3e8a
24 files changed
Lines changed: 647 additions & 283 deletions
File tree
- BREAKING_ARCHIVE
- core
- src
- components/router-outlet
- packages
- angular
- test/base
- e2e/src/standalone
- src/app/standalone
- app-standalone
- home-page
- swipe-gesture-disabled
- react-router
- src/ReactRouter
- test/base
- src
- pages
- swipe-to-go-back
- tests/e2e/specs
- vue
- src/components
- test/base
- src
- router
- views
- swipe-gesture-disabled
- tests/e2e/specs
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1589 | 1589 | | |
1590 | 1590 | | |
1591 | 1591 | | |
| 1592 | + | |
1592 | 1593 | | |
1593 | 1594 | | |
1594 | 1595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2915 | 2915 | | |
2916 | 2916 | | |
2917 | 2917 | | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
2918 | 2922 | | |
2919 | 2923 | | |
2920 | 2924 | | |
| |||
8229 | 8233 | | |
8230 | 8234 | | |
8231 | 8235 | | |
| 8236 | + | |
| 8237 | + | |
| 8238 | + | |
| 8239 | + | |
8232 | 8240 | | |
8233 | 8241 | | |
8234 | 8242 | | |
| |||
9723 | 9731 | | |
9724 | 9732 | | |
9725 | 9733 | | |
| 9734 | + | |
9726 | 9735 | | |
9727 | 9736 | | |
9728 | 9737 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
56 | 66 | | |
57 | 67 | | |
58 | 68 | | |
59 | 69 | | |
60 | | - | |
61 | | - | |
62 | | - | |
| 70 | + | |
63 | 71 | | |
64 | 72 | | |
65 | 73 | | |
| |||
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
124 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
125 | 138 | | |
126 | 139 | | |
127 | 140 | | |
128 | 141 | | |
129 | 142 | | |
130 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
131 | 150 | | |
132 | 151 | | |
133 | 152 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
58 | 66 | | |
59 | 67 | | |
60 | 68 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments