-
Notifications
You must be signed in to change notification settings - Fork 3k
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 - The Composer isn't getting focus again after the attachment modal is dismissed #53328
Conversation
@DylanDylann 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] |
runAfterInteraction causes a significant delay so I still think setTimeout(0) is the better option here. |
As mentioned here, I'm a little hesitant here |
@FitseTLT Let's update to use setTimeout, because I still see we use it many places (include new change recently) |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-12-04.at.10.27.00.movAndroid: mWeb ChromeScreen.Recording.2024-12-04.at.10.02.54.moviOS: NativeScreen.Recording.2024-12-04.at.10.03.38.moviOS: mWeb SafariScreen.Recording.2024-12-04.at.10.01.46.movMacOS: Chrome / SafariScreen.Recording.2024-12-04.at.09.59.25.movMacOS: DesktopScreen.Recording.2024-12-04.at.10.00.17.mov |
@@ -31,7 +32,8 @@ function focusComposerWithDelay(textInput: InputType | null): FocusComposerWithD | |||
if (!textInput) { | |||
return; | |||
} | |||
textInput.focus(); | |||
// When the closing modal has a focused text input focus() needs a delay to properly work. | |||
InteractionManager.runAfterInteractions(() => textInput.focus()); |
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.
Do you know why this focus isn't applied to mobile?
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.
This might help
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Lines 643 to 645 in 99912ca
// We want to focus or refocus the input when a modal has been closed or the underlying screen is refocused. | |
// We avoid doing this on native platforms since the software keyboard popping | |
// open creates a jarring and broken UX. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To Duration
Show details
Meaningless Changes To DurationShow entries
Show details
|
@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker. |
🚀 Deployed to staging by https://github.com/grgia in version: 9.0.72-0 🚀
|
🚀 Deployed to staging by https://github.com/grgia in version: 9.0.72-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.0.72-1 🚀
|
Details
Fixed Issues
$ #52898
PROPOSAL: #52898 (comment)
Tests
Offline tests
Same as above
QA Steps
Same as above
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label 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
a.foc.mp4
Android: mWeb Chrome
2024-11-30.02-10-10.mp4
iOS: Native
if.mp4
iOS: mWeb Safari
iw.mp4
MacOS: Chrome / Safari
w.mp4
MacOS: Desktop
d.mp4