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
[$250] Web - Distance - Unable to reorder waypoints using keyboard #83903
Version Number: 9.3.27-5 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#82500 Email or phone of affected tester (no customers):sjdsoijsoidjsndoinjsdoi@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
Open FAB > Track distance > Map.
Enter Start and Stop waypoint.
Tab to a waypoint.
Press space on the keyboard.
Press down arrow on the keyboard.
Expected Result:
In Step 5, after pressing space on a waypoint, it will be picked up so that user can move it down with keyboard (according to #79793).
Actual Result:
In Step 5, after pressing space on a waypoint, waypoint editor opens.
User cannot reorder waypoints using keyboard.
👋 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.
Classification: Frontend bug Causing PR: #82500 - "Add keyboard navigation support for autocomplete result rows" by @MobileMage (High confidence) Related Issues: None directly linked, but PR #80261 appears to contain additional keyboard handling fixes
Recommendation: REVERT
PR #82500 should be reverted from staging. The PR added keyboard navigation support to google-places-autocomplete rows, which appears to have introduced a conflict with the waypoint reordering keyboard shortcuts implemented in PR #79793.
Note: PR #80261 ("fix: resolve keyboard reordering edge cases in DraggableList") was merged shortly after #82500 and may contain relevant fixes. It should be included when re-landing #82500.
Labels: Removing DeployBlockerCash - this issue does not block the App deploy as it was caught during regression testing and only affects staging.
Uses DraggableList component with @dnd-kit KeyboardSensor
Space key is configured to start/end drag operations
Waypoint items use MenuItem component with role="button"
Root Cause
While the exact interaction mechanism is complex, the evidence strongly points to PR #82500 introducing a conflict with keyboard event handling that prevents waypoint reordering via Space key. The timing of PR #80261 (merged 2 hours after #82500 on the same day) with fixes for "keyboard reordering edge cases" suggests the issue was identified and fixed, but #80261 is not yet on staging.
changed the title [-]Web - Distance - Unable to reorder waypoints using keyboard[/-][+][$250] Web - Distance - Unable to reorder waypoints using keyboard[/+]on Mar 9, 2026
Please re-state the problem that we are trying to solve in this issue.
Keyboard reordering of waypoints in the distance request flow does not work. When a user Tabs to a waypoint and presses Space, the waypoint editor opens instead of initiating a drag-and-drop reorder. The expected behavior (from PR #79793) is that Space picks up the waypoint so arrow keys can move it.
What is the root cause of that problem?
The root cause is tabIndex={-1} on the SortableItem wrapper div at src/components/DraggableList/SortableItem.tsx:34-35. This was added by PR #79420 to fix a WCAG double-focus issue (two tab stops per waypoint: outer wrapper + inner MenuItem).
However, tabIndex={-1} removes the wrapper from the tab order entirely. dnd-kit's useSortable hook returns attributes with tabIndex=0 by default specifically so the wrapper can receive focus and keyboard events — but the override defeats this design.
The failure chain is:
User presses Tab — focus skips the wrapper (tabIndex={-1}) and lands on the inner MenuItem's Pressable (tabIndex=0, role="button")
User presses Space — React Native Web's PressResponder intercepts it, calls event.stopPropagation(), and treats it as a button press
dnd-kit's onKeyDown listener on the wrapper never fires because (a) the event was stopped by stopPropagation and (b) the wrapper never had focus to begin with
PressResponder triggers onPress, which navigates to the waypoint editor
Additionally, even if the event somehow reached the wrapper, dnd-kit's KeyboardSensor activator explicitly checks event.target !== activatorNode and rejects events originating from child elements.
PR #80261 (keyboard reordering edge case fixes) was merged but does not address tabIndex={-1} — it fixed Enter key conflicts, ghost drag state, and keyboard codes, but inherited the broken focus management.
What changes do you think we should make in order to solve the problem?
Remove the tabIndex={-1} override from the SortableItem wrapper so dnd-kit's default tabIndex=0 from attributes is applied, restoring keyboard reordering.
To preserve the WCAG single-tab-stop requirement (the original reason for tabIndex={-1}), add an onFocus handler on the wrapper that sets nested interactive children (buttons, elements with positive tabIndex) to tabIndex={-1} when the wrapper receives focus. This ensures only one tab stop per item while keeping the wrapper focusable for dnd-kit's KeyboardSensor.
Also extend the existing handleKeyDown capture handler to forward Enter presses to the first inner button, since the inner MenuItem is no longer directly tabbable.
What alternative solutions did you explore? (Optional)
useEffect + useRef approach — Set children non-tabbable on mount. More complex than the onFocus handler approach since it requires extra hooks/refs and doesn't handle dynamic content as naturally.
Dedicated drag-handle button — Add a separate focusable drag handle element. This would be a larger UX/design change and is unnecessary since the onFocus approach solves both requirements.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
Activity
melvin-bot commentedon Mar 2, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #82500
melvin-bot commentedon Mar 2, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Mar 2, 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:
OSBotify commentedon Mar 2, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #82500 - "Add keyboard navigation support for autocomplete result rows" by @MobileMage (High confidence)
Related Issues: None directly linked, but PR #80261 appears to contain additional keyboard handling fixes
Recommendation: REVERT
PR #82500 should be reverted from staging. The PR added keyboard navigation support to google-places-autocomplete rows, which appears to have introduced a conflict with the waypoint reordering keyboard shortcuts implemented in PR #79793.
Note: PR #80261 ("fix: resolve keyboard reordering edge cases in DraggableList") was merged shortly after #82500 and may contain relevant fixes. It should be included when re-landing #82500.
Labels: Removing DeployBlockerCash - this issue does not block the App deploy as it was caught during regression testing and only affects staging.
Detailed Analysis
Evidence
Verification
PR #82500 changed files:
patches/react-native-google-places-autocomplete/details.mdpatches/react-native-google-places-autocomplete/react-native-google-places-autocomplete+2.5.6+002+keyboard-navigation.patchThe patch adds keyboard accessibility to autocomplete rows including:
tabIndex={0}to make rows focusableaccessibilityRole="button"preventDefault()Waypoint reordering (from PR #79793):
Root Cause
While the exact interaction mechanism is complex, the evidence strongly points to PR #82500 introducing a conflict with keyboard event handling that prevents waypoint reordering via Space key. The timing of PR #80261 (merged 2 hours after #82500 on the same day) with fixes for "keyboard reordering edge cases" suggests the issue was identified and fixed, but #80261 is not yet on staging.
28 remaining items
melvin-bot commentedon Mar 9, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abzokhattab (
External)[-]Web - Distance - Unable to reorder waypoints using keyboard[/-][+][$250] Web - Distance - Unable to reorder waypoints using keyboard[/+]melvin-bot commentedon Mar 9, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022031094593402003287
melvin-bot commentedon Mar 9, 2026
Triggered auto assignment to @garrettmknight (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.MelvinBot commentedon Mar 9, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Keyboard reordering of waypoints in the distance request flow does not work. When a user Tabs to a waypoint and presses Space, the waypoint editor opens instead of initiating a drag-and-drop reorder. The expected behavior (from PR #79793) is that Space picks up the waypoint so arrow keys can move it.
What is the root cause of that problem?
The root cause is
tabIndex={-1}on the SortableItem wrapper div atsrc/components/DraggableList/SortableItem.tsx:34-35. This was added by PR #79420 to fix a WCAG double-focus issue (two tab stops per waypoint: outer wrapper + inner MenuItem).However,
tabIndex={-1}removes the wrapper from the tab order entirely. dnd-kit'suseSortablehook returnsattributeswithtabIndex=0by default specifically so the wrapper can receive focus and keyboard events — but the override defeats this design.The failure chain is:
tabIndex={-1}) and lands on the inner MenuItem's Pressable (tabIndex=0,role="button")PressResponderintercepts it, callsevent.stopPropagation(), and treats it as a button pressonKeyDownlistener on the wrapper never fires because (a) the event was stopped bystopPropagationand (b) the wrapper never had focus to begin withPressRespondertriggersonPress, which navigates to the waypoint editorAdditionally, even if the event somehow reached the wrapper, dnd-kit's KeyboardSensor activator explicitly checks
event.target !== activatorNodeand rejects events originating from child elements.PR #80261 (keyboard reordering edge case fixes) was merged but does not address
tabIndex={-1}— it fixed Enter key conflicts, ghost drag state, and keyboard codes, but inherited the broken focus management.What changes do you think we should make in order to solve the problem?
Remove the
tabIndex={-1}override from the SortableItem wrapper so dnd-kit's defaulttabIndex=0fromattributesis applied, restoring keyboard reordering.To preserve the WCAG single-tab-stop requirement (the original reason for
tabIndex={-1}), add anonFocushandler on the wrapper that sets nested interactive children (buttons, elements with positivetabIndex) totabIndex={-1}when the wrapper receives focus. This ensures only one tab stop per item while keeping the wrapper focusable for dnd-kit's KeyboardSensor.Also extend the existing
handleKeyDowncapture handler to forward Enter presses to the first inner button, since the inner MenuItem is no longer directly tabbable.What alternative solutions did you explore? (Optional)
tabIndex={-1}.useEffect+useRefapproach — Set children non-tabbable on mount. More complex than theonFocushandler approach since it requires extra hooks/refs and doesn't handle dynamic content as naturally.onFocusapproach solves both requirements.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.rushatgabhane commentedon Mar 12, 2026
Hi, I'm reopening #79247 as it was originally fixed there
So gonna close this one