-
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 can't close keyboard in some pages #46172
Fix can't close keyboard in some pages #46172
Conversation
@aimane-chnaif 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] |
@@ -162,8 +162,10 @@ function PrivateNotesEditPage({route, personalDetailsList, report, session}: Pri | |||
if (!el) { | |||
return; | |||
} | |||
if (!privateNotesInput.current) { | |||
updateMultilineInputRange(el); | |||
} |
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.
ios_p_note.mp4
@@ -90,8 +90,10 @@ function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) { | |||
if (!el) { | |||
return; | |||
} | |||
if (!reportDescriptionInputRef.current) { | |||
updateMultilineInputRange(el); | |||
} | |||
reportDescriptionInputRef.current = el; |
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.
ios_desc_room.mp4
@@ -178,8 +178,10 @@ function IOURequestStepDescription({ | |||
if (!el) { | |||
return; | |||
} | |||
if (!inputRef.current) { | |||
updateMultilineInputRange(el); | |||
} |
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.
ios_desc.mp4
updateMultilineInputRange(el); | ||
if (!inputRef.current) { | ||
updateMultilineInputRange(el); | ||
} |
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.
ios_exit_survey.mp4
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.
Coming from #50962 (BZ Checklist):
We’re missing a test for this case, and an error is visible in the screenshot video when the user navigates from the reason page to the response page. To address this, we should prevent using focus at the same time as other input functionalities related to input selection.
@@ -83,8 +83,10 @@ function NewTaskDescriptionPage({task}: NewTaskDescriptionPageProps) { | |||
accessibilityLabel={translate('newTaskPage.descriptionOptional')} | |||
role={CONST.ROLE.PRESENTATION} | |||
ref={(el) => { | |||
if (!inputRef.current) { | |||
updateMultilineInputRange(el); | |||
} |
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.
ios_task_description.mp4
@@ -116,8 +116,10 @@ function TaskDescriptionPage({report, currentUserPersonalDetails}: TaskDescripti | |||
if (!element) { | |||
return; | |||
} | |||
if (!inputRef.current) { | |||
updateMultilineInputRange(inputRef.current); | |||
} | |||
inputRef.current = element; |
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.
ios_task_description_2.mp4
if (!isInputInitializedRef.current) { | ||
updateMultilineInputRange(el); | ||
} | ||
isInputInitializedRef.current = true; |
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.
ios_profile_desc.mp4
^ Additional recording of the fix on other pages. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.mp4Android: mWeb Chromemchrome.mp4iOS: Nativeios.moviOS: mWeb SafariMacOS: Chrome / Safariweb.movMacOS: Desktop |
✋ 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/blimpich in version: 9.0.15-0 🚀
|
I think(not sure though) that this PR might have caused the regression here #46644 |
@MonilBhavsar I can't repro it but I think it's from this one #46177 |
Thanks for checking! Appreciate it |
🚀 Deployed to production by https://github.com/roryabraham in version: 9.0.15-9 🚀
|
Details
In some pages, we use updateMultilineInputRange inside the input ref callback. The ref callback is called multiple times, including when we close the keyboard. updateMultilineInputRange in iOS focus on the composer, so each time we close the keyboard, the updateMultilineInputRange will focus on it again.
Fixed Issues
$ #46134
PROPOSAL: #46134 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
(mWeb/Android/iOS only)
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