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
[Due for payment 2025-04-03] [$250] Group - Closed keyboard opens again after adding a user to a group #57758
Version Number: 9.1.8-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@alexpensify Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Tap on FAB
Tap on "Start chat"
Tap on the search input so the keyboard is opened
Select a any user tapping on "Add to group"
Verify the keyboard is not closed or reopened after selecting an user
Close the keyboard by defocusing the input
Select a member by tapping "Add to group"
Expected Result:
Keyboard is NOT opened again
Actual Result:
Keyboard opens again
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
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.
🚨 Edited by proposal-police: This proposal was edited at 2025-03-04 15:22:14 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Group - Closed keyboard opens again after adding a user to a group
What is the root cause of that problem?
toggleOption function triggers a call to selectionListRef.current?.focusTextInput(), which forces the text input to gain focus and opens the keyboard.
What changes do you think we should make in order to solve the problem?
We can disable the call to focusTextInput() within the toggleOption function when the action is triggered by clicking "addToGroup."
consttoggleOption=useCallback((option: ListItem&Partial<OptionData>,fromButton=false)=>{constisOptionInList=!!option.isSelected;letnewSelectedOptions;if(isOptionInList){newSelectedOptions=reject(selectedOptions,(selectedOption)=>selectedOption.login===option.login);}else{newSelectedOptions=[...selectedOptions,{...option,isSelected: true,selected: true,reportID: option.reportID??`${CONST.DEFAULT_NUMBER_ID}`}];selectionListRef?.current?.scrollToIndex(0,true);}// Only clear input and focus if not triggered from the addToGroup buttonif(!fromButton){selectionListRef?.current?.clearInputAfterSelect?.();selectionListRef.current?.focusTextInput();}setSelectedOptions(newSelectedOptions);},[selectedOptions,setSelectedOptions],);
⚠️ Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).
This was previously fixed in #33584 by not refocusing on touchscreen devices but this isn't working anymore since we are rendering a custom right component.
What changes do you think we should make in order to solve the problem?
We need to apply the same fix back to the custom right component.
if (!canUseTouchScreen()) {
selectionListRef.current?.focusTextInput();
}
Or we can use if (canFocusInputOnScreenFocus()).
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can create a test and mock the canUseTouchScreen return value and assert that the input isn't focused when canUseTouchScreen is true, and vice versa, when adding a user to the group selection.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.19-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@allroundexperts@JmillsExpensify@allroundexperts The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
N/A
Test:
Open New chat page from FAB
Blur the text input by pressing on anywhere or scroll the list
Add to group any user
Verify the input:
a. is refocused on web/desktop
b. not refocused on iOS/Android/mWeb
Activity
melvin-bot commentedon Mar 4, 2025
Triggered auto assignment to @JmillsExpensify (
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.daledah commentedon Mar 4, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-03-04 15:13:50 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Keyboard opens again
What is the root cause of that problem?
After selecting user, we focus input again
App/src/pages/NewChatPage.tsx
Line 217 in c406bee
What changes do you think we should make in order to solve the problem?
We should remove this line
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We have a test file here. Add new test to verify that input is not focus after select user
https://github.com/Expensify/App/blob/main/tests/ui/NewChatPageTest.tsx
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.
ryntgh commentedon Mar 4, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-03-04 15:22:14 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Group - Closed keyboard opens again after adding a user to a group
What is the root cause of that problem?
toggleOptionfunction triggers a call toselectionListRef.current?.focusTextInput(), which forces the text input to gain focus and opens the keyboard.What changes do you think we should make in order to solve the problem?
We can disable the call to
focusTextInput()within thetoggleOptionfunction when the action is triggered by clicking "addToGroup."What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Make a test to verify that clicking the "addToGroup" button does not open the keyboard
What alternative solutions did you explore? (Optional)
None
github-actions commentedon Mar 4, 2025
bernhardoj commentedon Mar 6, 2025
Coming from #29003 (comment)
Proposal
Please re-state the problem that we are trying to solve in this issue.
The keyboard shows again every time we add a user to the group selection.
What is the root cause of that problem?
This happens after #54994 where we always refocus the text input after adding a user to the group selection.
App/src/pages/NewChatPage.tsx
Lines 217 to 220 in c5bba74
This was previously fixed in #33584 by not refocusing on touchscreen devices but this isn't working anymore since we are rendering a custom right component.
App/src/pages/NewChatPage.tsx
Line 362 in c5bba74
What changes do you think we should make in order to solve the problem?
We need to apply the same fix back to the custom right component.
Or we can use
if (canFocusInputOnScreenFocus()).What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can create a test and mock the
canUseTouchScreenreturn value and assert that the input isn't focused whencanUseTouchScreenis true, and vice versa, when adding a user to the group selection.melvin-bot commentedon Mar 10, 2025
@JmillsExpensify Eep! 4 days overdue now. Issues have feelings too...
JmillsExpensify commentedon Mar 12, 2025
Opened up for proposal review.
25 remaining items
melvin-bot commentedon Mar 27, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.19-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-04-03. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 27, 2025
@allroundexperts @JmillsExpensify @allroundexperts The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
melvin-bot commentedon Apr 3, 2025
Payment Summary
Upwork Job
BugZero Checklist (@JmillsExpensify)
allroundexperts commentedon Apr 3, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/54994/files#r2026532178
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Verify the input:
a. is refocused on web/desktop
b. not refocused on iOS/Android/mWeb
Do we agree 👍 or 👎
bernhardoj commentedon Apr 3, 2025
Requested in ND.
JmillsExpensify commentedon Apr 7, 2025
Payment summary:
garrettmknight commentedon Apr 9, 2025
Payment summary:
Contributor: @bernhardoj $250 via New Expensify
Reviewer: @allroundexperts $250 via New Expensify
JmillsExpensify commentedon Apr 9, 2025
$250 approved for @bernhardoj
JmillsExpensify commentedon Jun 13, 2025
$250 approved for @allroundexperts