Repository navigation
[Exploratory] iOS - Fix screen flicker when tapping Cancel to exit edit mode - #99398
Conversation
handleEditFocus hardcoded forceKeyboardIfAlreadyFocused to true, so
leaving edit mode (Cancel or Save) also went through the forced path.
On iOS this tears down and rebuilds an already-visible keyboard via
KeyboardController.setFocusTo('current'), causing a one-frame flicker
in the report list ~150ms after exit. Only force it while entering
edit mode.
|
@hoangzinh Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-08-27.at.18.42.43.movAndroid: mWeb ChromeScreen.Recording.2026-08-27.at.18.18.51.moviOS: HybridAppScreen.Recording.2026-08-27.at.18.13.06.moviOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-08-27.at.18.15.30.mov |
|
@mukhrr can you complete Author checklist? |
|
@hoangzinh completed. |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #97768 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
🚧 blimpich has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.4.63-0 🚀
|
|
🤖 I reviewed the changes and no help site changes are required under Why: This PR is a single-line, internal focus/keyboard-timing fix in The relevant help article, Chat Features and Moderation Tools, documents how to edit and delete messages, and that behavior is unchanged — the steps remain accurate. There's nothing to update, so no draft docs PR was created. @mukhrr, since no docs changes are needed, there's no linked help site PR to review. If you believe a user-facing behavior did change and should be documented, let me know and I'll draft one. |
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.4.63-1 🚀
Bundle Size Analysis (Sentry): |
|
@blimpich thanks. That was my 100th PR got merged into production) |
|
Wooohoo!! Nice job! That's a big milestone 👍 |
Explanation of Change
On iOS, tapping Cancel to exit edit mode re-focuses the main composer through
useEditComposerToggle's exit branch, which callshandleEditFocus→focus(true, undefined, true). The third arg (forceKeyboardIfAlreadyFocused) was hardcodedtrue, so even though the composer never lost focus on cancel,focusComposerWithDelaystill took the already-focused branch and calledrequestKeyboardForFocusedComposer(native-only) afterCONST.COMPOSER_FOCUS_DELAY. On iOS,KeyboardController.setFocusTo('current')tears down and rebuilds the already-visible keyboard (inputView = nil; reloadInputViews(); focus()), causing the report list to render blank for a single frame.The flag was added for Android in
489139080beto force the keyboard back up when entering edit mode. This change only forces it whileeditingState === CONST.REPORT_ACTION_EDIT_MESSAGE_STATE.EDITING(i.e. on entry), so exiting edit mode (Cancel or Save, both go through the samestopEditing()→OFFbranch) no longer forces a keyboard reload.Fixed Issues
$ #97768
PROPOSAL: #97768 (comment)
Tests
Offline tests
Same as Tests — this is a pure focus/keyboard-timing change with no network dependency.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
REC-20260825212610.mp4
Android: mWeb Chrome
REC-20260825214350.mp4
iOS: Native
ios-97768-cancel-fix.mp4
iOS: mWeb Safari
REC-20260825214950.mp4
MacOS: Chrome / Safari
REC-20260825212758.mp4