Skip to content

[Odometer] [$250] Distance - Odometer - Next button is hidden behind the keyboard #82647

Closed

Description

@jponikarchuk

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.20-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #82204
Email or phone of affected tester (no customers): applausetester+ihbuiivyw@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: iPhone 15 Pro Max / iOS 26.2
App Component: Money Requests

Action Performed:

Precondition:

  • Log in with Expensifail account.
  1. Launch Expensify app.
  2. Open FAB > Track distance > Odometer.
  3. Tap Start reading field.

Expected Result:

Next button will appear above the keyboard.

Actual Result:

Next button is hidden behind the keyboard.
Tapping outside the keyboard does not dismiss the keyboard. User cannot reach Next button when keyboard is opened.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7080320_1771331827221.ScreenRecording_02-17-2026_20-33-01_1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @Krishna2323
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022026439552787883189
  • Upwork Job ID: 2026439552787883189
  • Last Price Increase: 2026-02-24

Activity

  1. daledah commented on Feb 17, 2026

    @daledah
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Next button is hidden behind the keyboard. Tapping outside the keyboard does not dismiss the keyboard. User cannot reach Next button when keyboard is opened.

    What is the root cause of that problem?

    In DistanceRequestStartPage.tsx, the ScreenWrapper has shouldEnableKeyboardAvoidingView={false}. This was fine when only the Map and Manual tabs existed (they don't use native keyboard TextInputs), but now the Odometer tab uses standard TextInput components that trigger the native keyboard. Since KeyboardAvoidingView is disabled, the view doesn't resize when the keyboard opens, so the Next button at the bottom remains behind the keyboard and is unreachable.

    shouldEnableKeyboardAvoidingView={false}

    What changes do you think we should make in order to solve the problem?

    We should make shouldEnableKeyboardAvoidingView dynamic based on the currently selected tab. When the Odometer tab is active, enable it so the view resizes properly when the keyboard appears.

    --- a/src/pages/iou/request/DistanceRequestStartPage.tsx
    +++ b/src/pages/iou/request/DistanceRequestStartPage.tsx
    @@ -172,7 +172,7 @@
             >
                 <ScreenWrapper
    -                shouldEnableKeyboardAvoidingView={false}
    +                shouldEnableKeyboardAvoidingView={selectedTab === CONST.TAB_REQUEST.DISTANCE_ODOMETER}
                     shouldEnableMinHeight={canUseTouchScreen()}
                     testID="DistanceRequestStartPage"
                     focusTrapSettings={{containerElements: focusTrapContainerElements}}

    What alternative solutions did you explore? (Optional)

    An alternative would be wrapping the Odometer content in its own KeyboardAvoidingView inside IOURequestStepDistanceOdometer.tsx, but this approach is less ideal because the parent ScreenWrapper already provides this functionality — we just need to enable it conditionally.

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  2. abbasifaizan70 commented on Feb 17, 2026

    @abbasifaizan70
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    The Next button is hidden behind the keyboard. Tapping outside does not dismiss the keyboard. User cannot reach the Next button while the keyboard is open.

    Platforms: Android App, iOS App.

    What is the root cause of that problem?

    The Odometer step is shown as a tab inside DistanceRequestStartPage. That page uses a single ScreenWrapper with shouldEnableKeyboardAvoidingView={false}, so no KeyboardAvoidingView is active for the whole screen (header, tab bar, and tab content). When the user focuses the Start or End reading field on the Odometer tab, the keyboard opens and the layout does not shift; the Next button stays at the bottom and is covered by the keyboard.

    When creating a new request from the Track distance flow, the Odometer content is rendered with shouldShowWrapper={!isCreatingNewRequest} (i.e. true → false), so StepScreenWrapper does not render its inner ScreenWrapper and the form is rendered directly under the page’s ScreenWrapper. Thus the Odometer form never gets keyboard-avoiding behavior. The form is also not inside a ScrollView, so there is no scroll-to-reveal and no drag-to-dismiss for the keyboard.

    Relevant code (permallinks to main):

    • DistanceRequestStartPage – ScreenWrapper with shouldEnableKeyboardAvoidingView={false} wraps the entire page (header, tab bar, and tab content). No keyboard offset is passed.

      <ScreenWrapper
      shouldEnableKeyboardAvoidingView={false}
      shouldEnableMinHeight={canUseTouchScreen()}
      testID="DistanceRequestStartPage"
      focusTrapSettings={{containerElements: focusTrapContainerElements}}
      >

    • IOURequestStepDistanceOdometer – Form content is a single View with justifyContentBetween; no ScrollView and no keyboard-avoiding wrapper when used as tab content.

      quickAction,
      policyRecentlyUsedCurrencies,
      introSelected,
      activePolicyID,
      privateIsArchived: reportNameValuePairs?.private_isArchived,
      selfDMReport,
      policyForMovingExpenses,
      odometerStart: start,
      odometerEnd: end,
      odometerDistance: calculatedDistance,

    What changes do you think we should make in order to solve the problem?

    1. DistanceRequestStartPage – When the Odometer tab is selected, enable keyboard avoiding on the page ScreenWrapper and set keyboardVerticalOffset so the visible header and tab bar are accounted for (same pattern as IOURequestStepDestination when opened from the start page). This keeps the Next button above the keyboard on Android and iOS.

    2. IOURequestStepDistanceOdometer – Wrap the form in a ScrollView with keyboardShouldPersistTaps="handled" (so the Next button remains tappable with the keyboard open) and keyboardDismissMode="on-drag" (so scrolling/dragging dismisses the keyboard). Use contentContainerStyle={[styles.flexGrow1]} so layout and button position are preserved while allowing scroll when needed.

    Solution – new code (git diff):

    --- a/App/src/pages/iou/request/DistanceRequestStartPage.tsx
    +++ b/App/src/pages/iou/request/DistanceRequestStartPage.tsx
    @@ -14,6 +14,8 @@ import usePermissions from '@hooks/usePermissions';
     import usePersonalPolicy from '@hooks/usePersonalPolicy';
     import usePolicy from '@hooks/usePolicy';
     import usePrevious from '@hooks/usePrevious';
    +import useSafeAreaInsets from '@hooks/useSafeAreaInsets';
     import useThemeStyles from '@hooks/useThemeStyles';
     import {canUseTouchScreen} from '@libs/DeviceCapabilities';
    +import variables from '@styles/variables';
     import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
     import Navigation from '@libs/Navigation/Navigation';
     import OnyxTabNavigator, {TabScreenWithFocusTrapWrapper, TopTab} from '@libs/Navigation/OnyxTabNavigator';
    @@ -50,6 +52,7 @@ function DistanceRequestStartPage({
     }: DistanceRequestStartPageProps) {
         const styles = useThemeStyles();
         const {translate} = useLocalize();
    +    const {top} = useSafeAreaInsets();
         const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {canBeMissing: true});
         const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID}`, {canBeMissing: true});
         const policy = usePolicy(report?.policyID);
    @@ -162,11 +165,15 @@ function DistanceRequestStartPage({
         const focusTrapContainerElements = useMemo(() => {
             return [headerWithBackBtnContainerElement, tabBarContainerElement, activeTabContainerElement].filter((element) => !!element);
         }, [headerWithBackBtnContainerElement, tabBarContainerElement, activeTabContainerElement]);
     
    +    const isOdometerTabSelected = selectedTab === CONST.TAB_REQUEST.DISTANCE_ODOMETER;
    +    const keyboardVerticalOffset =
    +        isOdometerTabSelected ? variables.contentHeaderHeight + top + variables.tabSelectorButtonHeight + variables.tabSelectorButtonPadding : undefined;
    +
         return (
             <AccessOrNotFoundWrapper
                 reportID={reportID}
                 iouType={iouType}
                 policyID={policy?.id}
                 accessVariants={[CONST.IOU.ACCESS_VARIANTS.CREATE]}
                 allPolicies={allPolicies}
             >
                 <ScreenWrapper
    -                shouldEnableKeyboardAvoidingView={false}
    +                shouldEnableKeyboardAvoidingView={isOdometerTabSelected}
    +                keyboardVerticalOffset={keyboardVerticalOffset}
                     shouldEnableMinHeight={canUseTouchScreen()}
                     testID="DistanceRequestStartPage"
                     focusTrapSettings={{containerElements: focusTrapContainerElements}}
                 >
    
    --- a/App/src/pages/iou/request/step/IOURequestStepDistanceOdometer.tsx
    +++ b/App/src/pages/iou/request/step/IOURequestStepDistanceOdometer.tsx
    @@ -2,6 +2,7 @@ import reportsSelector from '@selectors/Attributes';
     import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
     import {View} from 'react-native';
    +import ScrollView from '@components/ScrollView';
     import type {OnyxEntry} from 'react-native-onyx';
     import Button from '@components/Button';
     import FormHelpMessage from '@components/FormHelpMessage';
    @@ -414,7 +415,13 @@ function IOURequestStepDistanceOdometer({
                 includeSafeAreaPaddingBottom
             >
                 <View style={[styles.flex1, styles.flexColumn, styles.justifyContentBetween, styles.ph5, styles.pt5, styles.mb5]}>
    +            <ScrollView
    +                style={[styles.flex1]}
    +                contentContainerStyle={[styles.flexGrow1]}
    +                keyboardShouldPersistTaps="handled"
    +                keyboardDismissMode="on-drag"
    +            >
                     <View>
                         {/* Start Reading */}
                         <View style={[styles.mb6, styles.flexRow, styles.alignItemsCenter, styles.gap3]}>
    @@ -594,6 +601,7 @@ function IOURequestStepDistanceOdometer({
                         />
                     </View>
                 </View>
    +            </ScrollView>
                 <DiscardChangesConfirmation
                     isEnabled={shouldEnableDiscardConfirmation}
                     getHasUnsavedChanges={() => {
  3. melvin-bot commented on Feb 23, 2026

    @melvin-bot

    Huh... This is 4 days overdue. Who can take care of this?

  4. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 24, 2026
  5. melvin-bot commented on Feb 24, 2026

    @melvin-bot

    Triggered auto assignment to @bfitzexpensify (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.

  6. MelvinBot commented on Feb 24, 2026

    @MelvinBot
    Contributor

    🔍 Issue Analysis

    Summary: The Next button on the Odometer tab in the Track Distance flow is hidden behind the keyboard because the parent ScreenWrapper has keyboard avoidance explicitly disabled, and the Odometer component has no fallback scroll or keyboard-dismiss behavior.

    Root Cause: DistanceRequestStartPage.tsx:173 sets shouldEnableKeyboardAvoidingView={false} on its ScreenWrapper. This was appropriate when only the Map and Manual tabs existed (neither uses native keyboard TextInputs), but the Odometer tab introduces TextInput fields for Start/End readings that trigger the native keyboard. Since the KeyboardAvoidingView is disabled, the layout does not resize when the keyboard opens, leaving the Next button hidden behind it.

    Additionally, when creating a new request, the Odometer component's StepScreenWrapper renders with shouldShowWrapper={!isCreatingNewRequest} (i.e., false), so it skips its own ScreenWrapper entirely (IOURequestStepDistanceOdometer.tsx:490). This means there is no KeyboardAvoidingView at any level during new request creation.

    Recommended Fix: Make shouldEnableKeyboardAvoidingView conditional based on the selected tab — enable it when the Odometer tab is active, keep it disabled for other tabs. This is the minimal change that addresses the core issue without risking regressions on the Map/Manual/GPS tabs.

    shouldEnableKeyboardAvoidingView={selectedTab === CONST.TAB_REQUEST.DISTANCE_ODOMETER}
    

    Note on Existing Proposals

    Both contributor proposals correctly identify the root cause. @daledah's proposal is the simpler and more focused fix — toggling shouldEnableKeyboardAvoidingView based on the selected tab. @abbasifaizan70's proposal adds a ScrollView and keyboardVerticalOffset computation on top, which may provide additional resilience on very small screens but also introduces more surface area for regressions.

    One consideration: the keyboardVerticalOffset may need to be set to account for the header + tab bar height above the content area, depending on how react-native-keyboard-controller computes the avoiding offset. This should be validated during testing on both iOS and Android.

    Detailed Investigation

    Root Cause Analysis

    The view hierarchy for the Odometer tab during new request creation is:

    1. DistanceRequestStartPage → ScreenWrapper with shouldEnableKeyboardAvoidingView={false}
    2. ScreenWrapper → ScreenWrapperContainer → KeyboardAvoidingView with enabled={false}
    3. Inside the tab: IOURequestStepDistanceOdometer → StepScreenWrapper with shouldShowWrapper={false}
    4. StepScreenWrapper just renders children in FullPageNotFoundView — no secondary ScreenWrapper

    The Odometer form content (IOURequestStepDistanceOdometer.tsx:493-622) is a plain View with flexColumn and justifyContentBetween:

    • Top section: Start/End reading TextInput fields with DECIMAL_PAD keyboard
    • Bottom section: Error message + Next Button

    With KeyboardAvoidingView disabled and no ScrollView, when the keyboard opens:

    • The layout does not resize or add padding
    • The Next button remains at the absolute bottom of the view, behind the keyboard
    • There is no keyboard dismiss handler for tapping outside the inputs

    Evidence Chain

    shouldEnableKeyboardAvoidingView={false} on DistanceRequestStartPage.tsx:173 → ScreenWrapperContainer receives enabled={false} → KeyboardAvoidingView from react-native-keyboard-controller is disabled on iOS/Android → layout does not adjust when keyboard opens → Next button (positioned via justifyContentBetween) stays at original position → keyboard covers it

    Relevant Code

    Implementation Notes

    • The fix should be conditional (only enable for Odometer tab) to avoid potential side effects on Map/Manual/GPS tabs
    • A keyboardVerticalOffset may be needed to account for the header and tab bar — should be tested on device
    • The "tapping outside doesn't dismiss keyboard" symptom is secondary; with keyboard avoiding enabled, the Next button will be visible and usable even with the keyboard open

    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Feb 24, 2026
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 24, 2026
  9. 12 remaining items

  10. added
    ReviewingHas a PR in review
    and removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 26, 2026
  11. changed the title [-][$250] Distance - Odometer - Next button is hidden behind the keyboard[/-] [+][Odometer] [$250] Distance - Odometer - Next button is hidden behind the keyboard[/+] on Mar 2, 2026
  12. Julesssss commented on Mar 3, 2026

    @Julesssss
    Contributor

    Upstream blocker was merged.

  13. Julesssss commented on Mar 12, 2026

    @Julesssss
    Contributor

    Upstream blocker was reverted, awaiting new PR here.

  14. Julesssss commented on Mar 12, 2026

    @Julesssss
    Contributor

    PR merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions