-
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
focus logic update for multiline fields #27702
Conversation
@0xmiroslav 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] |
PR is ready for review @0xmiroslav |
Hi @thienlnam what we are dealing with is the top down transition on multiline inputs where we set focus using the ref and set cursor and scroll all together. The transition's (which is the actual bug report) RCA is that focus is set immediately and cursor is set using selection range and scroll is also adjusted together, so by the time second and third operations complete, the field is already in focus and after completion of other operations, we see the top down transition. The solution I came up with is setting the cursor and scroll as soon as input ref is available but set the focus after the transition delay, which is in line with the newly agreed focus logic here and correct solution wrt the rca https://expensify.slack.com/archives/C01GTK53T8Q/p1694660990479979 But the problem is that scroll does not work in native iOS platform which is an RN bug (I suppose, got insights from this PR: #20836 ) and this scroll issue for ios is still persistent in the app along with the top down transition for all platform. Now we have 2 ways: either we let the ios issue be and wait for the real fix to come regarding the scroll and continue with the top down transition fix on all other platforms, (these are the options which we have as per mine and @0xmiroslav 's debugging) you can see the pr for reference, holding this PR on your response @0xmiroslav @thienlnam |
let me know your thoughts so we can proceed |
Adding my cents here:
|
Friendly reminder @thienlnam |
Thanks for the summary - let's go with option 2 so we fix the mentioned bug and then create a separate tracking issue for the iOS scrolling issue and add comments in the code about why we're doing this and link to the tracking issue. |
Got it, will amend the PR accordingly |
ok please let me know when ready |
on it now @0xmiroslav |
pr is ready for review, tests passed @0xmiroslav |
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.
Update multiline data
to multiline text
in Test step.
Also capitalize first letter in each sentence.
done @0xmiroslav |
@chiragxarora please fix conflict |
done @0xmiroslav , pls check again |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.movDesktopdesktop.moviOSios.movAndroidandroid.mov |
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.
LGTM!
@thienlnam all yours
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.
Awesome, thank ya!
✋ 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/thienlnam in version: 1.3.73-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.73-1 🚀
|
🚀 Deployed to staging by https://github.com/thienlnam in version: 1.3.74-0 🚀
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.74-3 🚀
|
@0xmiroslav @thienlnam Sorry to jump in on this fairly old issue, but any idea if a tracking issue (as suggested here) was created for the iOS issue. The code just links here. |
I don't think issue was created for that. And not worth fixing for now I believe, focusing on other priority issues. |
Details
Fixed Issues
$ #21654
PROPOSAL: #21654 (comment)
Tests
Offline tests
N/A
QA Steps
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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Screen.Recording.2023-09-18.at.11.22.38.PM.mov
Mobile Web - Chrome
Screen.Recording.2023-09-19.at.12.09.28.AM.mov
Mobile Web - Safari
Screen.Recording.2023-09-19.at.12.06.11.AM.mov
Desktop
Screen.Recording.2023-09-19.at.12.23.37.AM.mov
iOS
Screen.Recording.2023-09-19.at.12.02.32.AM.mov
Android
Screen.Recording.2023-09-19.at.12.09.28.AM.mov