Fix Android KeyboardBehavior detach issue on page navigation#43
Fix Android KeyboardBehavior detach issue on page navigation#43Copilot wants to merge 3 commits into
Conversation
Co-authored-by: davidortinau <41873+davidortinau@users.noreply.github.com>
|
@copilot how should I test this behavior to confirm the fix? |
… fix Co-authored-by: davidortinau <41873+davidortinau@users.noreply.github.com>
I've created a comprehensive testing infrastructure to validate the Android KeyboardBehavior fix. The key testing scenarios are: 1. Transient Page Navigation Test
2. Singleton Page Navigation Test
3. Memory Leak Prevention
4. Rapid Navigation Stress Test
I've added test pages to the sample app and created a detailed Run the sample app on Android and navigate to "Test Navigation Scenarios" to access all the test cases. The guide includes specific things to watch for and a verification checklist. Commit: 3776d3e |
Problem
The Android implementation of
KeyboardBehaviorhad a critical bug where event handlers were not being properly detached during page navigation:OnAttachedTo()attached the KeyPress event handler to the parent layout, butOnDetachedFrom()tried to detach from theplatformViewinsteadOnDetachedFrom()was called, causing crashesSolution
_attachedLayoutfield to store reference to the layout that event handlers are attached toOnDetachedFrom()to detach from the correct layout object_attachedLayoutis always reset to null to prevent memory leaksThis fix ensures proper cleanup for both transient and singleton pages while maintaining consistency with the iOS and Windows implementations.
Fixes #42.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.