Commit 053bfdd
feat: Implement scroll-to-top for native TabView (#54)
* feat: implement scroll-to-top for native TabView using Combine
Implement proper SwiftUI approach for detecting tab reselection:
- Add Combine PassthroughSubject to capture all tab taps
- Create intermediate binding that publishes tap events
- Use onReceive to dispatch TabbarClickAction for scroll-to-top
- Works for both tab switches and same-tab taps
- Pure SwiftUI solution without UIKit introspection
This enables the native iOS behavior where tapping an active tab
scrolls content to the top, matching standard iOS app behavior.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* fix: update tab selection unconditionally for consistency
Apply Copilot suggestion to always update selectedTab binding value,
even when tapping the same tab. This ensures the TabView selection
stays in sync and simplifies the binding logic.
Setting the same value is harmless in SwiftUI and prevents potential
sync issues between the intermediate binding and the actual state.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>1 parent 20050d7 commit 053bfdd
1 file changed
+23
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
25 | 43 | | |
26 | 44 | | |
27 | 45 | | |
28 | | - | |
| 46 | + | |
29 | 47 | | |
30 | 48 | | |
31 | 49 | | |
| |||
83 | 101 | | |
84 | 102 | | |
85 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
86 | 108 | | |
87 | 109 | | |
88 | 110 | | |
| |||
0 commit comments