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
[Payment Due June 16, 2025] [$250] mWeb - Search - In search, scrolling the page doesn't close the keypad. #61521
Version Number: V9.1.40-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: N/a Email or phone of affected tester (no customers): Slottwo1 sivappa2@gmail.com Issue reported by: Applause Internal Team Device used: Redminote note 10s android 13 phone App Component: Chat Report View
// Only dismiss the keyboard whenever the user scrolls the screen
if(!isScreenTouched){
return;
}
Keyboard.dismiss();
};
constdefaultOnScroll=()=>{// Only dismiss the keyboard whenever the user scrolls the screenif(!isScreenTouched){return;}if(dismissExternalKeyboard){dismissExternalKeyboard();return}Keyboard.dismiss();};
The dismissExternalKeyboard function would look like this:
However, for <div contenteditable="true" />, TextInputState.currentlyFocusedField() returns null because there is no logic to update TextInputState._currentlyFocusedNode in this case. This is the root cause of the bug.
What changes do you think we should make in order to solve the problem?
To resolve this, we need to ensure that TextInputState._currentlyFocusedNode is also updated for <div contenteditable="true" /> elements. This requires two steps:
Step 1: Export TextInputState from react-native-web so it can be used externally.
What alternative solutions did you explore? (Optional)
After implementing Step 1, another option is to update TextInputState._currentlyFocusedNode directly within the Expensify app instead of react-native-live-markdown. For example, update:
changed the title [-]mWeb - Search - In search, scrolling the page doesn't close the keypad.[/-][+][$250] mWeb - Search - In search, scrolling the page doesn't close the keypad.[/+]on May 13, 2025
Activity
melvin-bot commentedon May 6, 2025
Triggered auto assignment to @muttmuure (
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.linhvovan29546 commentedon May 7, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
mWeb - Search - In search, scrolling the page doesn't close the keypad.
What is the root cause of that problem?
We already have logic to dismiss the keyboard on scroll, which works as expected in other parts of the app.
App/src/components/SelectionList/index.tsx
Lines 60 to 66 in 9586baf
However, it doesn’t work in the search screen because the search input is rendered via the SearchAutocompleteInput component.
App/src/components/Search/SearchAutocompleteInput.tsx
Line 226 in 9586baf
Looking deeper, this component uses a
TextInputwith the typemarkdown, which on the web renders as adivwithcontentEditable. As a result, callingKeyboard.dismiss()has no effect in this OPhttps://github.com/Expensify/react-native-live-markdown/blob/main/src/MarkdownTextInput.web.tsx#L772-L775
What changes do you think we should make in order to solve the problem?
I think we can fix this by manually
blurthe input instead of relying on Keyboard.dismiss(). Here's the approach:dismissExternalKeyboardin theSelectionListcomponent.defaultOnScrollhandler, calldismissExternalKeyboard()to hide the keyboard.App/src/components/SelectionList/index.tsx
Lines 60 to 66 in 9586baf
dismissExternalKeyboardfunction would look like this:App/src/components/Search/SearchAutocompleteList.tsx
Line 566 in 9586baf
textInputRefas a prop fromSearchRoutertoSearchAutocompleteList.App/src/components/Search/SearchRouter/SearchRouter.tsx
Line 356 in 9586baf
Note: We should also check other components like SearchPageHeaderInput and apply the same solution
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Since this is a keyboard interaction issue specific to web behavior, automated testing isn't necessary in this case.
What alternative solutions did you explore? (Optional)
truph01 commentedon May 9, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
The
SelectionListcomponent already includes logic to dismiss the keyboard on scroll:App/src/components/SelectionList/index.tsx
Line 65 in 9586baf
This logic calls
Keyboard.dismiss(), which, on the web platform, invokes:See: https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/modules/dismissKeyboard/index.js
On web, there are two types of input elements:
<input /><div contenteditable="true" />(used in our search input)For
<input />, the keyboard dismissal works correctly because the currently focused node is tracked through:https://github.com/necolas/react-native-web/blob/922c134f2b7c428cc19daaeb3cac4b6a4c8ec6a3/packages/react-native-web/src/exports/TextInput/index.js#L285
<div contenteditable="true" />,TextInputState.currentlyFocusedField()returnsnullbecause there is no logic to updateTextInputState._currentlyFocusedNodein this case. This is the root cause of the bug.What changes do you think we should make in order to solve the problem?
To resolve this, we need to ensure that
TextInputState._currentlyFocusedNodeis also updated for<div contenteditable="true" />elements. This requires two steps:Step 1: Export
TextInputStatefromreact-native-webso it can be used externally.Update this logic:
https://github.com/necolas/react-native-web/blob/922c134f2b7c428cc19daaeb3cac4b6a4c8ec6a3/packages/react-native-web/src/exports/NativeModules/index.js#L10-L15
From:
To:
Step 2: Update the
TextInputState._currentlyFocusedNodewhen the contenteditable div receives focus.Modify the logic here:
https://github.com/Expensify/react-native-live-markdown/blob/0a5c7736d876ad11762aa88c736c1c9b860eedc7/src/MarkdownTextInput.web.tsx#L552-L553
From:
To:
What alternative solutions did you explore? (Optional)
TextInputState._currentlyFocusedNodedirectly within the Expensify app instead ofreact-native-live-markdown. For example, update:App/src/components/RNMarkdownTextInput.tsx
Line 52 in 9ad4ccb
To:
melvin-bot commentedon May 12, 2025
@muttmuure Eep! 4 days overdue now. Issues have feelings too...
[-]mWeb - Search - In search, scrolling the page doesn't close the keypad.[/-][+][$250] mWeb - Search - In search, scrolling the page doesn't close the keypad.[/+]melvin-bot commentedon May 13, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021922351372001950494
36 remaining items
melvin-bot commentedon Jun 20, 2025
@muttmuure Whoops! This issue is 2 days overdue. Let's get this updated quick!
muttmuure commentedon Jun 22, 2025
$250 - @parasharrajat C+
$250 - @truph01 C
parasharrajat commentedon Jun 24, 2025
@muttmuure @truph01 needs to be paid via Upwork. Can you please confirm whether they are paid? If so, let's close this issue. I will request later.
muttmuure commentedon Jun 25, 2025
@truph01 has been paid in Upwork
parasharrajat commentedon Jul 28, 2025
Payment requested as per #61521 (comment)
twisterdotcom commentedon Jul 31, 2025
@parasharrajat has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-0f1f-a8d8-beaf-08d15ddcf211truph01 commentedon Dec 30, 2025
@muttmuure You mentioned here that I had been paid (#61521 (comment)), but I haven’t actually received any payment via Upwork yet.
Could you please help double-check this?