-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix composer not focused when pressing key after coming from WS share code page #46855
Fix composer not focused when pressing key after coming from WS share code page #46855
Conversation
@ZhenjaHorbach Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: Native2024-08-06.12.22.01.movAndroid: mWeb Chrome2024-08-06.11.54.29.moviOS: Native2024-08-06.11.40.50.moviOS: mWeb Safariweb-ios.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
@bernhardoj 2024-08-06.11.42.19.mov |
And it's strange |
That's because we dismiss the modal. It's a common pattern to dismiss the RHP when going to report screen. App/src/pages/ReimbursementAccount/ConnectBankAccount/components/FinishChatCard.tsx Line 44 in 3775dae
App/src/pages/ReimbursementAccount/ConnectBankAccount/components/FinishChatCard.tsx Line 30 in 3775dae
App/src/libs/actions/Report.ts Lines 2083 to 2097 in 290a9d9
Otherwise, the App/src/libs/Navigation/AppNavigator/AuthScreens.tsx Lines 181 to 191 in 3775dae
That's weird, the keyboard opens just fine from my side android.mp4 |
Sorry 2024-08-06.11.54.29.movBut as far as I can see in your video |
This actually sounds like a good idea ! |
Do you mean the auto focus? It'll only auto focus if the chat is empty. From your video, looks like the chat isn't loaded yet, so perhaps it's detected as an empty chat. App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Lines 291 to 296 in 41e27c9
Updated. I didn't remove the beforeRemove to reduce risk of regressions. Please check! |
Yes |
@@ -26,6 +27,10 @@ function FocusTrapForScreen({children}: FocusTrapProps) { | |||
return isFocused; | |||
} | |||
|
|||
if (route.name === NAVIGATORS.FULL_SCREEN_NAVIGATOR) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a bit comment as in other conditions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just retested after not dismissing the RHP, this fix isn't needed anymore, so I remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm, everything works
Thanks for cleaning the code
LGTM |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/techievivek in version: 9.0.18-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.18-10 🚀
|
Details
The composer will be focused if there is no modal visible anymore, but when we open the share code page and go to #admins, the RHP is not dismissed. This PR fix it.
Fixed Issues
$ #46206
PROPOSAL: #46206 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
(For web/desktop)
5. Click anywhere to remove focus from composer
6. Press any key
7. Verify the composer is focused with the green outline and the key character is added to the composer
(For iOS/Android/mWeb)
8. Press the composer
9. Verify the composer is focused with the green outline
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4