-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(ios): TabView does not emit page navigatingFrom in iOS 17 #10757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(ios): TabView does not emit page navigatingFrom in iOS 17 #10757
Conversation
WalkthroughThe changes update the event-handling logic for tab navigation in iOS and its corresponding automated test. On the iOS side, the emission of the Changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
View your CI Pipeline Execution ↗ for commit 9d16c0d.
☁️ Nx Cloud last updated this comment at |
View your CI Pipeline Execution ↗ for commit 9d16c0d.
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/core/ui/page/index.ios.ts (1)
284-290
: Correct implementation of deferred event emission.The logic properly checks for the pending flag, cleans it up, and emits the
navigatingFrom
event with the correctisBack
parameter. This addresses the iOS 17 tab lifecycle timing issue.Consider using an undefined assignment instead of the
delete
operator for better performance:- delete this['_isPendingNavigatingFrom']; + this['_isPendingNavigatingFrom'] = undefined;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/automated/src/ui/tab-view/tab-view-root-tests.ts
(2 hunks)packages/core/ui/page/index.ios.ts
(2 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
packages/core/ui/page/index.ios.ts
[error] 286-286: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: test-android
🔇 Additional comments (6)
apps/automated/src/ui/tab-view/tab-view-root-tests.ts (4)
2-2
: LGTM! Import addition is necessary for event handling.The addition of
EventData
import is required for the new event handler functionality.
143-148
: Good synchronization mechanism for deferred events.The test correctly implements synchronization for the
navigatingFrom
event that is now deferred in the iOS implementation. The boolean flag and event handler pattern ensures the test waits for the event to fire.
154-156
: Proper event listener setup and synchronization.The test correctly attaches the event listener before the tab switch and waits for the event to occur, which aligns with the deferred event emission behavior implemented in the iOS core.
158-158
: Expected events updated to reflect deferred behavior.The expected events array correctly includes the
navigatingFrom
event for the third tab's page, matching the new deferred emission behavior.packages/core/ui/page/index.ios.ts (2)
257-263
: Well-implemented deferral logic for iOS 17 tab issue.The logic correctly identifies tab bar controller scenarios where the
navigatingFrom
event needs to be deferred. The condition checks ensure the deferral only happens when necessary (tab switching scenarios).
272-272
: Good variable naming consistency.Unifying the variable name from
page
toowner
improves consistency with the rest of the method.
PR Checklist
What is the current behavior?
On iOS 17, the
navigatingFrom
event was not triggered for pages inside TabView tabs.The lifecycle of tabs changed on iOS 18, resulting in also breaking automated tests.
What is the new behavior?
This PR adds a workaround to emit the
navigatingFrom
for TabView Pages even on versions that seem faulty.Summary by CodeRabbit