Commit dd92b66
authored
[iOS/Mac] Fixed OnBackButtonPressed not firing for Shell Navigation Bar Button (#34401)
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->
### Issue Details
The OnBackButtonPressed override is not triggered when the back button
in the Shell Navigation Bar is clicked.
### Root Cause
The ShouldPopItem method (called by iOS navigation bar when the back
button is tapped) calls SendPop(), which only checks for
BackButtonBehavior.Command but never calls Page.SendBackButtonPressed().
### Description of Change
Added SendBackButtonPressed() check inside the tracker loop in
SendPop(), after the existing BackButtonBehavior.Command check, before
the break.
### Validated the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [x] iOS
- [x] Mac
### Issues Fixed:
Fixes #34190
### Screenshots
| Before | After |
|---------|--------|
| <video
src="https://github.com/user-attachments/assets/6987afb2-8a0d-4bb0-aa49-8f5b53931bae">
| <video
src="https://github.com/user-attachments/assets/a32ed322-7ec4-44f4-94de-dc56c191a79f">
|1 parent 23a7503 commit dd92b66
3 files changed
Lines changed: 16 additions & 11 deletions
File tree
- src/Controls
- src/Core/Compatibility/Handlers/Shell/iOS
- tests
- TestCases.HostApp/Issues
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
147 | 153 | | |
148 | 154 | | |
149 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
Lines changed: 9 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
| |||
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
0 commit comments