You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android - Expense - List dopdown auto closes after focusing on text field and opening list #101802
Version Number: 9.4.91-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack: github.com//pull/100735 Email or phone of affected tester (no customers):sjodjoijsonjoinj@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Samsung Galaxy S25 FE / Android 16 App Component: Money Requests
Action Performed:
Precondition:
Create text and list type report field.
Launch Expensify app.
Go to workspace chat.
Create an expense.
Open the expense.
Tap on the text report field.
Tap list report field.
Expected Result:
List dopdown will not auto close after focusing on text field and opening list.
Actual Result:
List dopdown auto closes after focusing on text field and opening list.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
This PR is the sole source of the inline report-field editor and has produced three Android deploy blockers in one release; a targeted fix would have to change FilterPopupButton, which is shared by the Search filter bar and the Table filter bar, and that is not a safe change to land mid-deploy. Reverting removes all three blockers at once and the feature can re-land with the dropdown open made idempotent.
Assigned: @daledah (PR author), @Gonals (approving reviewer) from highest-confidence causing PR only — already assigned by melvin-bot, no change needed Labels: No changes. DeployBlockerCash is kept (App PR caused it, fix lands in Expensify/App). DeployBlocker is not present, so nothing to remove.
Before this PR, report fields in the report view were MenuItem rows that navigated to DynamicEditReportFieldPage. There was no inline text input and no inline list dropdown, so the code path in the repro steps did not exist in production. The PR creates src/components/MoneyRequestReportView/ReportFieldInlineInput.tsx (new file, +246) and rewrites MoneyReportView.tsx (+19/−64) to use it.
Two sibling deploy blockers filed against the same build (Expensify/App#101798, Expensify/App#101799) are also Android report-field bugs in this same new component.
Within the PR's own history the dropdown was first implemented with a local isOptionListVisible state opened by the idempotentsetIsOptionListVisible(true), and was then refactored to FilterPopupButton, which replaced that with a toggle. That refactor is where the regression enters.
Verification
Affected files, all touched by Expensify/App#100735:
FilterPopupButton has no open action — it only has a toggle, and it hands that same toggle out under three different names:
FilterPopupButton.tsx#L81-L112 — toggleOverlay is passed as the trigger's onPress, as the popover's onClose, and as closeOverlay to the popover content. Every one of those flips the state rather than setting it, so a second invocation of the "open" action closes the dropdown.
That was safe for every pre-existing consumer, because all of them (DropdownButton, TableFilterTrigger, SearchAdvancedFiltersButton, TableDisplaySettingsTrigger, …) render a Button as the trigger: one unambiguous press path, no keyboard involved.
ReportFieldInlineInput is the first consumer to render a TextInput as the trigger, and it binds the toggle to two trigger props at once:
A TextInput already has more than one press path on native — BaseTextInput wires the consumer's onPress both to the wrapping PressableWithoutFeedback (index.native.tsx#L315-L317) and to the inner input's onPressOut (index.native.tsx#L441) — and onSubmitEditing adds a third. With an idempotent setVisible(true) that redundancy is harmless; with a toggle, the second trigger closes the dropdown.
What makes the failure Android-only and dependent on step 5 (focusing the text field first) is that the open becomes asynchronous and re-entrant exactly when a soft keyboard is up:
FilterPopupButton routes its entire open through this (#L96-L106). With no keyboard up, cb() runs synchronously and a single tap produces a single toggle, which is why the list field works when you tap it directly. After step 5 the keyboard is up, so:
toggleOverlay() is deferred behind a keyboardDidHide listener.
Any further trigger (onSubmitEditing, or the second press path) reaches toggleOverlay after the deferred one has already opened the dropdown, flipping it straight back closed — the reported "auto closes".
The deferral is additionally unsound: the "is the keyboard up?" flag isVisible is maintained from React Native's Keyboard events (#L14-L20) while the wait is on react-native-keyboard-controller's KeyboardEvents. These fire at different times on Android, and focusing the list input (showSoftInputOnFocus={false} via disableKeyboard) already starts hiding the keyboard before onPress runs. On the e.height !== 0 branch the listener is never removed, so a stale cb() can fire on a later keyboard hide and toggle the dropdown shut.
DatePicker — the closest analogue, also a TextInput with disableKeyboard that opens a popover — does not have this problem precisely because its open is idempotent and intent-guarded: DatePicker/index.tsx#L129-L145 uses setPickerVisibility(true) plus an openIntentRef so a deferred open is dropped if the picker was dismissed meanwhile.
If a roll-forward is preferred over a revert, the minimal change is to stop using a toggle as the open action:
In FilterPopupButton, split toggleOverlay into openOverlay (setIsOverlayVisible(true)) and closeOverlay (setIsOverlayVisible(false)), pass openOverlay as the trigger's onPress, and pass the real closeOverlay (not the toggle) as both onClose and the closeOverlay prop given to PopoverComponent.
Guard the deferred open in calculatePopoverPositionAndToggleOverlay with an intent ref, mirroring DatePicker's openIntentRef, and bail out if another trigger already opened it.
In ReportFieldInlineInput, do not bind the same handler to both onPress and onSubmitEditing.
Note also that inputStyle={styles.pointerEventsNone} on the trigger (#L211) is a no-op: BaseTextInput appends styles.pointerEventsAuto after inputStyle in the style array, so the inner input stays tappable and its onPressOut path stays live. That is pre-existing (DatePicker does the same), but it is why the "taps only reach the wrapper" assumption does not hold here.
What remains unverified: I could not run this on an Android device, so the exact ordering of the second trigger (onSubmitEditing versus the inner onPressOut/wrapper onPress pair) and the precise keyboardDidHide interleaving between RN Keyboard and react-native-keyboard-controller are inferred from the code rather than observed. The defect being fixed — a toggle used as an open action, reached from multiple triggers and deferred asynchronously — holds regardless of which of those wins the race.
💡 Suggested AI code review rule
This bug looks like a recurring, mechanically detectable pattern, so it may be worth a coding-standards rule so the AI reviewer catches the next one. Proposed for Expensify/App:
Rule:CLEAN-REACT-PATTERNS-10 — Open and close overlays with explicit actions, never a shared toggle
Condition: Flag a component that exposes or binds a setX(prev => !prev) toggle as its open or close action — including passing one toggle as both onPress/onClose/closeOverlay, or binding the same handler to more than one trigger prop on a single control (onPress + onSubmitEditing). Use separate idempotent open()/close() setters instead, and guard any asynchronously deferred open with an intent ref.
Why: A toggle is only correct when every trigger is guaranteed to fire exactly once. Controls with multiple press paths (a TextInput wires onPress to both its wrapper Pressable and the inner input's onPressOut) and asynchronously deferred opens (KeyboardUtils.dismissKeyboardAndExecute on Android) both break that guarantee, so the second trigger closes what the first just opened. Incident: this issue.
Search pattern:setIsOverlayVisible\(\(?\w+\)? => ! / set\w+\(prev => !prev\) whose result is passed to a prop named open*, close*, or onClose; and the same identifier appearing in two trigger props on one JSX element, e.g. onPress=\{(\w+)\}[\s\S]{0,200}onSubmitEditing=\{\1\}
The full rule file, with the ❌/✅ code inline in Expensify/App's app-coding-standards format, would go in Expensify/App itself. If it's worth adding, a maintainer can open it there as a draft PR.
Activity
applause-bot commentedon Sep 21, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/7c9de857ac9abc472498019075a96e7e65dc993c1edf4d8b4bf15f242667ff14
melvin-bot commentedon Sep 21, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #100735
github-actions commentedon Sep 21, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
melvin-bot commentedon Sep 21, 2026
@Gonals @daledah you have been assigned to this deploy blocker because you reviewed the offending PR: #100735
melvin-bot commentedon Sep 21, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Sep 21, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: Show up to three report fields per row and edit them inline (
Expensify/App#100735) by @daledah (High confidence)Related Issues: Android - Expense - Report field value jumps when navigating from one report to another (
Expensify/App#101798), Android - Expense - Report auto scrolls to bottom after opening report field (Expensify/App#101799) — both also Android, both also in the new inline report-field UI from the same PRRecommendation: REVERT
This PR is the sole source of the inline report-field editor and has produced three Android deploy blockers in one release; a targeted fix would have to change
FilterPopupButton, which is shared by the Search filter bar and the Table filter bar, and that is not a safe change to land mid-deploy. Reverting removes all three blockers at once and the feature can re-land with the dropdown open made idempotent.Assigned: @daledah (PR author), @Gonals (approving reviewer) from highest-confidence causing PR only — already assigned by melvin-bot, no change needed
Labels: No changes.
DeployBlockerCashis kept (App PR caused it, fix lands inExpensify/App).DeployBlockeris not present, so nothing to remove.📋 Detailed Analysis
Evidence
Expensify/App#100735is on the 9.4.91-0 Deploy Checklist: New Expensify 2026-09-21.MenuItemrows that navigated toDynamicEditReportFieldPage. There was no inline text input and no inline list dropdown, so the code path in the repro steps did not exist in production. The PR createssrc/components/MoneyRequestReportView/ReportFieldInlineInput.tsx(new file, +246) and rewritesMoneyReportView.tsx(+19/−64) to use it.Expensify/App#101798,Expensify/App#101799) are also Android report-field bugs in this same new component.isOptionListVisiblestate opened by the idempotentsetIsOptionListVisible(true), and was then refactored toFilterPopupButton, which replaced that with a toggle. That refactor is where the regression enters.Verification
Affected files, all touched by
Expensify/App#100735:src/components/MoneyRequestReportView/ReportFieldInlineInput.tsx— new file in this PR, renders the list report fieldsrc/components/MoneyRequestReportView/MoneyRequestViewReportFields.tsx— rewritten in this PR to renderReportFieldInlineInputPre-existing files the new code newly depends on (unchanged by the PR, but only now reachable from a report field):
src/components/Search/FilterDropdowns/FilterPopupButton.tsxsrc/utils/keyboard/index.android.tsRoot Cause
FilterPopupButtonhas noopenaction — it only has a toggle, and it hands that same toggle out under three different names:FilterPopupButton.tsx#L81-L112—toggleOverlayis passed as the trigger'sonPress, as the popover'sonClose, and ascloseOverlayto the popover content. Every one of those flips the state rather than setting it, so a second invocation of the "open" action closes the dropdown.That was safe for every pre-existing consumer, because all of them (
DropdownButton,TableFilterTrigger,SearchAdvancedFiltersButton,TableDisplaySettingsTrigger, …) render aButtonas the trigger: one unambiguous press path, no keyboard involved.ReportFieldInlineInputis the first consumer to render aTextInputas the trigger, and it binds the toggle to two trigger props at once:ReportFieldInlineInput.tsx#L216-L218A
TextInputalready has more than one press path on native —BaseTextInputwires the consumer'sonPressboth to the wrappingPressableWithoutFeedback(index.native.tsx#L315-L317) and to the inner input'sonPressOut(index.native.tsx#L441) — andonSubmitEditingadds a third. With an idempotentsetVisible(true)that redundancy is harmless; with a toggle, the second trigger closes the dropdown.What makes the failure Android-only and dependent on step 5 (focusing the text field first) is that the open becomes asynchronous and re-entrant exactly when a soft keyboard is up:
src/utils/keyboard/index.android.ts#L50-L69FilterPopupButtonroutes its entire open through this (#L96-L106). With no keyboard up,cb()runs synchronously and a single tap produces a single toggle, which is why the list field works when you tap it directly. After step 5 the keyboard is up, so:toggleOverlay()is deferred behind akeyboardDidHidelistener.onSubmitEditing, or the second press path) reachestoggleOverlayafter the deferred one has already opened the dropdown, flipping it straight back closed — the reported "auto closes".isVisibleis maintained from React Native'sKeyboardevents (#L14-L20) while the wait is onreact-native-keyboard-controller'sKeyboardEvents. These fire at different times on Android, and focusing the list input (showSoftInputOnFocus={false}viadisableKeyboard) already starts hiding the keyboard beforeonPressruns. On thee.height !== 0branch the listener is never removed, so a stalecb()can fire on a later keyboard hide and toggle the dropdown shut.DatePicker— the closest analogue, also aTextInputwithdisableKeyboardthat opens a popover — does not have this problem precisely because its open is idempotent and intent-guarded:DatePicker/index.tsx#L129-L145usessetPickerVisibility(true)plus anopenIntentRefso a deferred open is dropped if the picker was dismissed meanwhile.If a roll-forward is preferred over a revert, the minimal change is to stop using a toggle as the open action:
FilterPopupButton, splittoggleOverlayintoopenOverlay(setIsOverlayVisible(true)) andcloseOverlay(setIsOverlayVisible(false)), passopenOverlayas the trigger'sonPress, and pass the realcloseOverlay(not the toggle) as bothonCloseand thecloseOverlayprop given toPopoverComponent.calculatePopoverPositionAndToggleOverlaywith an intent ref, mirroringDatePicker'sopenIntentRef, and bail out if another trigger already opened it.ReportFieldInlineInput, do not bind the same handler to bothonPressandonSubmitEditing.Note also that
inputStyle={styles.pointerEventsNone}on the trigger (#L211) is a no-op:BaseTextInputappendsstyles.pointerEventsAutoafterinputStylein the style array, so the inner input stays tappable and itsonPressOutpath stays live. That is pre-existing (DatePickerdoes the same), but it is why the "taps only reach the wrapper" assumption does not hold here.What remains unverified: I could not run this on an Android device, so the exact ordering of the second trigger (
onSubmitEditingversus the inneronPressOut/wrapperonPresspair) and the precisekeyboardDidHideinterleaving between RNKeyboardandreact-native-keyboard-controllerare inferred from the code rather than observed. The defect being fixed — a toggle used as an open action, reached from multiple triggers and deferred asynchronously — holds regardless of which of those wins the race.💡 Suggested AI code review rule
This bug looks like a recurring, mechanically detectable pattern, so it may be worth a coding-standards rule so the AI reviewer catches the next one. Proposed for
Expensify/App:CLEAN-REACT-PATTERNS-10— Open and close overlays with explicit actions, never a shared togglesetX(prev => !prev)toggle as its open or close action — including passing one toggle as bothonPress/onClose/closeOverlay, or binding the same handler to more than one trigger prop on a single control (onPress+onSubmitEditing). Use separate idempotentopen()/close()setters instead, and guard any asynchronously deferred open with an intent ref.TextInputwiresonPressto both its wrapperPressableand the inner input'sonPressOut) and asynchronously deferred opens (KeyboardUtils.dismissKeyboardAndExecuteon Android) both break that guarantee, so the second trigger closes what the first just opened. Incident: this issue.setIsOverlayVisible\(\(?\w+\)? => !/set\w+\(prev => !prev\)whose result is passed to a prop namedopen*,close*, oronClose; and the same identifier appearing in two trigger props on one JSX element, e.g.onPress=\{(\w+)\}[\s\S]{0,200}onSubmitEditing=\{\1\}ReportFieldInlineInput.tsx#L216-L218andFilterPopupButton.tsx#L81-L112DatePicker/index.tsx#L109-L145The full rule file, with the ❌/✅ code inline in
Expensify/App'sapp-coding-standardsformat, would go inExpensify/Appitself. If it's worth adding, a maintainer can open it there as a draft PR.melvin-bot commentedon Sep 21, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
melvin-bot commentedon Sep 21, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
melvin-bot commentedon Sep 22, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
Gonals commentedon Sep 22, 2026
PR Reverted
IuliiaHerets commentedon Sep 22, 2026
Xiaomi Redmi Note 10 / Android 12
9.4.91-1
Not repro
Screenrecorder-2026-09-22-14-15-01-465.mp4