Skip to content

[Due for payment 2026-01-07 (PAID)] [$250] Workspace - Keypad appears briefly on tapping back button to go back to Add field pg #67945

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.1.89-4
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: Exploratory around #67191
Email or phone of affected tester (no customers): applausetester+ck482025@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Pixel 8a/Android 15
App Component: Workspace Settings

Action Performed:

  1. Launch Hybrid app on Android device
  2. Go to Workspace settings >> Reports (upgrade to control if not done before)
  3. Tap on Add Field >> Click on Name field
  4. Do not enter any text, tap on back button to go back to add field page (Note: Keypad appears briefly when navigating back)
  5. Tap on type field >> select Text type
  6. Click Initial value field
  7. Do not enter any text, tap on back button to go back to add field page (Note: Keypad appears briefly when navigating back)

Expected Result:

Keypad should not appear briefly at the bottom when tapping on back button to navigate back to add field page

Actual Result:

Keypad appears briefly on tapping back button to go back to Add field page

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021953701030105266250
  • Upwork Job ID: 1953701030105266250
  • Last Price Increase: 2025-11-21
  • Automatic offers:
    • QichenZhu | Reviewer | 109896590
Issue OwnerCurrent Issue Owner: @QichenZhu

Activity

  1. added
    Daily
    Bug
    on Aug 5, 2025
  2. melvin-bot commented on Aug 5, 2025

    @melvin-bot

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

  3. Krishna2323 commented on Aug 5, 2025

    @Krishna2323
    Contributor

    Proposal

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

    Workspace - Keypad appears briefly on tapping back button to go back to Add field pg

    What is the root cause of that problem?

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

    • Call Keyboard.dismiss.
            KeyboardUtils.dismiss().then(() => {
                setIsPickerVisible(false);
            });
    • Or we can call Keyboard.dismiss in TextSelectorModal.
      const hide = useCallback(() => {
      onClose();
      if (shouldClearOnClose) {
      setValue('');
      }
      }, [onClose, shouldClearOnClose]);
    • Also check for similar bugs in other modal screens like this.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    N/A

    What alternative solutions did you explore? (Optional)

    • We can update the Modal component to dismiss the modal when hiding, we can also consider adding a flag for that.

    Result

  4. RachCHopkins commented on Aug 8, 2025

    @RachCHopkins
    Contributor

    Ok that's really weird and I'm not on that version so I can't repro. Will have to take your word for it!

  5. added
    External
    on Aug 8, 2025
  6. changed the title [-]Workspace - Keypad appears briefly on tapping back button to go back to Add field pg[/-] [+][$250] Workspace - Keypad appears briefly on tapping back button to go back to Add field pg[/+] on Aug 8, 2025
  7. melvin-bot commented on Aug 8, 2025

    @melvin-bot
  8. added
    Help Wanted
    on Aug 8, 2025
  9. melvin-bot commented on Aug 8, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (External)

  10. dmkt9 commented on Aug 10, 2025

    @dmkt9
    Contributor

    Proposal

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

    Keypad appears briefly on tapping back button to go back to Add field page

    What is the root cause of that problem?

    1. Since here we use shouldUseReanimatedModal for Modal:

      shouldUseReanimatedModal

      So ModalComponent will use ReanimatedModal instead of ReactNativeModal:
      if ((type && REANIMATED_MODAL_TYPES.includes(type)) || shouldUseReanimatedModal) {
      return (
      <ReanimatedModal

    2. In ReanimatedModal we have similar logic ReactNativeModal (react-native-modal library) but with a difference, in which we use Animated from react-native-reanimated to create containerView:

      const containerView = (
      <Container

      <Animated.View
      style={[styles.modalAnimatedContainer, type !== CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED && styles.flex1]}
      entering={Entering}
      exiting={Exiting}
      >

    3. On Android, TextInput does not lose focus immediately when we click on another component like on the web (to lose focus we have to handle the event when clicking on another area and call blur for TextInput), so blur processing will be slower than web.

    4. Android does not have time to handle focus cancellation
      When TextInput is in focus and the component is suddenly unmounted (for example when Modal is closed), Android still keeps the keyboard open. But because the view has disappeared, it has no point to "anchor" the keyboard → the keyboard is closed immediately.

    5. Reanimated Modal can delay unmounting or layout processing during animation. This makes Android "think" that the keyboard needs to open, then immediately realize that there is no view → the keyboard is closed.

    Note: If you set the log on TextInput's onBlur, you can see that this event is not triggered on Android.

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

    There are a few options:

    1. Option 1: Remove shouldUseReanimatedModal:

      shouldUseReanimatedModal

    2. Option 2: Use setTimeout with appropriate time here to give the system time to process the blur event and for the keyboard:

      setIsVisibleState(false);

      Example:

    setTimeout(() => setIsVisibleState(false), Keyboard.isVisible() ? animationOutTiming : 0);
    1. Option 3: Use KeyboardUtils.dissmis() here, ensuring the keyboard is closed completely and also allowing time for the system to handle the blur event:
      setIsVisibleState(false);
    KeyboardUtils.dismiss().then(() => setIsVisibleState(false));

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    NA

    What alternative solutions did you explore? (Optional)

    NA

    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.

    Result:

    Option 2:

    Screencast.from.2025-08-10.21-26-33.webm

    Option 3:

    Screencast.from.2025-08-10.21-27-14.webm
  11. 202 remaining items

  12. RachCHopkins commented on Jan 13, 2026

    @RachCHopkins
    Contributor

    I would normally close this at this point, but are we adding an additional proposal/PR here?

  13. QichenZhu commented on Jan 13, 2026

    @QichenZhu
    Contributor

    @TaduJR the new proposal is quite big so I need more time to review it. But I wanted to let you know that since the approach is different from the original one, it might not count as a follow-up and could be a separate issue (which needs to go through triage and we might not be hired). Please check if the problem is actually that complicated or if it's over-engineered.

  14. TaduJR commented on Jan 13, 2026

    @TaduJR
    Contributor

    @TaduJR #67945 (comment) is quite big so I need more time to review it. But I wanted to let you know that since the approach is different from #67945 (comment), it might not count as a follow-up and could be a separate issue (which needs to go through triage and we might not be hired). Please check if the problem is actually that complicated or if it's over-engineered.

    @QichenZhu As stated on the alternative solution on the proposal we could do target fix like this one which is relatively very easy, but I chose to make a fix that target all these kinds of issue for future and that address from the deepest root cause that why it got long. Please feel free to take your time for feedback.

  15. changed the title [-][Due for payment 2026-01-07] [$250] Workspace - Keypad appears briefly on tapping back button to go back to Add field pg[/-] [+][Due for payment 2026-01-07 (PAID)] [$250] Workspace - Keypad appears briefly on tapping back button to go back to Add field pg[/+] on Jan 14, 2026
  16. melvin-bot commented on Jan 16, 2026

    @melvin-bot

    @QichenZhu Whoops! This issue is 2 days overdue. Let's get this updated quick!

  17. QichenZhu commented on Jan 19, 2026

    @QichenZhu
    Contributor

    @TaduJR I'm not keen on the main solution since the issue can happen when the user doesn't click the back button in the header, but an item in the list (see video below). I prefer fixing it in SearchRouterContext instead. cc @francoisl

    67945b.mov
  18. TaduJR commented on Feb 4, 2026

    @TaduJR
    Contributor

    Hi @francoisl

    I didn't notice your reaction, because there wasn't a notification.

    So should I go ahead an create PR using the alternative solution? Just double checking that you agreed with it.

  19. francoisl commented on Feb 9, 2026

    @francoisl
    Contributor

    Does the problem still happen now? I can't reproduce the original issue, nor see the keyboard flash when I close the Search on my Android device.
    This issue is getting long and hard to parse, and references code that has now changed a bunch – maybe it would be best to close this as resolved and open a separate issue if there's still something to address.

  20. TaduJR commented on Feb 9, 2026

    @TaduJR
    Contributor

    Yea just checked, No longer repo @francoisl

    Let's close this.

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions