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
[$1000] [HOLD for payment 2023-02-08] mWeb/Chrome - Focus is lost and the keyboard does not reopen after pressing "+" button #13443
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
The focus is not lost, and the keyboard opens again
Actual Result:
Focus is lost and the keyboard does not reopen
Workaround:
unknown
Platform:
Where is this issue occurring?
Mobile Web
Version Number: 1.2.37-2 Reproducible in staging?: y Reproducible in production?: y Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos:
Okay after looking into this it does seem like this is only happening on mobile web. Web, iOS, Android all properly give focus back to the composer input after closing this modal.
I've chased it down I think to something with detecting if touch/focus exists here:
Because we have native file src/libs/canFocusInputOnScreenFocus/index.native.js for the counter-part src/libs/canFocusInputOnScreenFocus/index.js
So it could be something within src/libs/canUseTouchscreen/index.js that causes the Web src/libs/canFocusInputOnScreenFocus/index.js to do something strange and not give focus back.
I ran out of time today with trying to confirm the value of what canFocusInputOnScreenFocus on my phone b/c of local dev headaches so I'll pick it back up on Monday.
that isn't triggered on the iOS app so the app must have some native code somewhere controlling this and is why we get the difference in behavior but I'm pretty confused.
changed the title [-][HOLD for payment 2023-02-08] mWeb/Chrome - Focus is lost and the keyboard does not reopen after pressing "+" button[/-][+][$1000] [HOLD for payment 2023-02-08] mWeb/Chrome - Focus is lost and the keyboard does not reopen after pressing "+" button[/+]on Feb 8, 2023
As for the regression test, we have an existing test for focus in the creation flow, so I think we're good on this consideration. Checking that item off the list.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Dec 8, 2022
Triggered auto assignment to @michaelhaxhiu (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.bondydaa commentedon Dec 9, 2022
Okay after looking into this it does seem like this is only happening on mobile web. Web, iOS, Android all properly give focus back to the composer input after closing this modal.
I've chased it down I think to something with detecting if touch/focus exists here:
App/src/pages/home/report/ReportActionCompose.js
Line 138 in a75a01e
Because we have native file
src/libs/canFocusInputOnScreenFocus/index.native.jsfor the counter-partsrc/libs/canFocusInputOnScreenFocus/index.jsSo it could be something within
src/libs/canUseTouchscreen/index.jsthat causes the Websrc/libs/canFocusInputOnScreenFocus/index.jsto do something strange and not give focus back.I ran out of time today with trying to confirm the value of what
canFocusInputOnScreenFocuson my phone b/c of local dev headaches so I'll pick it back up on Monday.bondydaa commentedon Dec 13, 2022
got stuck fighting with my VM yesterday, will finish off investigation today. dropping this to weekly since I don't think it's a major issue.
bondydaa commentedon Dec 13, 2022
okay yep figured this out.
Using this diff
To just console log the value of

this.shouldFocusInputOnScreenFocuswe can see that in a non-mobile web browser that variable istrueBut on mobile safari that is

falseAnd for sake of completeness iOS app show

falseas wellAfter adding more logs I can tell that this logic is what is making it so that non-mobile web gets the focus back on the input https://github.com/Expensify/App/blob/1c60740ac8/src/pages/home/report/ReportActionCompose.js#L176-L179
that isn't triggered on the iOS app so the app must have some native code somewhere controlling this and is why we get the difference in behavior but I'm pretty confused.
looks like @parasharrajat did both #2022 and #4687 so do you have any insights here?
kidroca commentedon Dec 15, 2022
IMO there's no BUG here
I remember this behavior was discussed extensively in multiple tickets in GH (year ago) and (I think) taken and resolved internally
AFAIK It was decided to
Since mobile web is a case using software keyboard the expected behavior would be not to display the software keyboard after closing a popup
The case with the Emoji picker is an exception as that's tied to composing a message, therefore interacting with it moves focus back to the composer
With the (+) button users are typically moving away from composing long enough to warrant NOT expanding the keyboard automatically
bondydaa commentedon Dec 15, 2022
Forgot to link the slack thread we started but here where I summarized what we've discussed https://expensify.slack.com/archives/C01GTK53T8Q/p1671127362759299?thread_ts=1671056016.060879&cid=C01GTK53T8Q will post a summary once I make sure we're all on the same page - I think we are but just want to double check 😅
42 remaining items
[-][HOLD for payment 2023-02-08] mWeb/Chrome - Focus is lost and the keyboard does not reopen after pressing "+" button[/-][+][$1000] [HOLD for payment 2023-02-08] mWeb/Chrome - Focus is lost and the keyboard does not reopen after pressing "+" button[/+]MelvinBot commentedon Feb 8, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01e1c94921fb1cc24b
MelvinBot commentedon Feb 8, 2023
Current assignee @JmillsExpensify is eligible for the External assigner, not assigning anyone new.
MelvinBot commentedon Feb 8, 2023
Current assignee @eVoloshchak is eligible for the External assigner, not assigning anyone new.
MelvinBot commentedon Feb 8, 2023
Current assignee @bondydaa is eligible for the External assigner, not assigning anyone new.
JmillsExpensify commentedon Feb 8, 2023
Looking at the linked PR, looks like @eVoloshchak helped so I'm added external and triggering an Upwork job.
JmillsExpensify commentedon Feb 8, 2023
Let me know when you've applied to the job above and we can get the payment for C+ PR review squared away!
JmillsExpensify commentedon Feb 8, 2023
As for the regression test, we have an existing test for focus in the creation flow, so I think we're good on this consideration. Checking that item off the list.
eVoloshchak commentedon Feb 9, 2023
@JmillsExpensify, applied!
JmillsExpensify commentedon Feb 9, 2023
Offer sent!
JmillsExpensify commentedon Feb 9, 2023
Paid out via Upwork, closing this one out!