-
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
iOS - Hybrid app - Split - Cursor jumps in front of digit when deleting participant's amount #51306
iOS - Hybrid app - Split - Cursor jumps in front of digit when deleting participant's amount #51306
Conversation
@rayane-djouah 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: Nativeandroid_native.mp4Android: mWeb Chromeandroid_mweb_chrome.mp4iOS: NativeSimulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-10-30.at.13.16.52.mp4iOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-10-30.at.12.26.51.mp4MacOS: Chrome / SafariScreen.Recording.2024-10-30.at.12.21.58.PM.movMacOS: DesktopScreen.Recording.2024-10-30.at.12.22.27.PM.mov |
@WojtekBoman BUG: On the Android native app, when splitting android_native.mp4 |
This ^ bug is also reproducible on the main branch |
@WojtekBoman BUG: On the iOS native app, when splitting Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-10-30.at.12.31.41.mp4 |
This ^ bug is also reproducible on the main branch |
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 and tests well 👍
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.
Thanks for the fix and a review from @rayane-djouah !
✋ 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/mountiny in version: 9.0.56-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.56-9 🚀
|
Details
This PR fixes two issues with the jumping cursor on iOS:
This issue was caused by reading an old value from input in
onSelectionChange
.onSelectionChange
usese.nativeEvent.selection
andformattedAmount
to determine the cursor position. When we update amount on iOS, theformattedAmount
value read inonSelectionChange
is the previous value and not the value given in thesetNewAmount
function. To fix this,amountRef
has been added to read the updated value. Thanks to this, the cursor position is now read correctly.Before fix:
Screen.Recording.2024-10-24.at.11.11.51.mov
After:
Screen.Recording.2024-10-24.at.09.11.49.mov
For large numbers, formatting is important, removing one number can reduce the number in the input by many characters. In this case, if we specify the cursor position on an old number with more characters, we point to an index that does not exist, this causes the cursor to jump to the beginning.
This issue has been fixed by changing the value of
shouldIgnoreSelectionWhenUpdatedManually
totrue
on iOS. This prevents theselection
from being updated twice, which was the source of the problem.Before fix:
Screen.Recording.2024-10-24.at.11.12.15.mov
After:
Screen.Recording.2024-10-24.at.09.12.14.mov
Fixed Issues
$ #50886
PROPOSAL:
Tests
Offline tests
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 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
Screen.Recording.2024-10-24.at.10.24.53.mov
Android: mWeb Chrome
Screen.Recording.2024-10-24.at.10.38.38.mov
iOS: Native
Screen.Recording.2024-10-24.at.09.10.36.mov
iOS: mWeb Safari
Screen.Recording.2024-10-24.at.09.51.54.mov
MacOS: Chrome / Safari
Screen.Recording.2024-10-24.at.10.48.40.mov
MacOS: Desktop
Screen.Recording.2024-10-24.at.09.55.40.mp4