Fix suggestion list cursor bug#67720
Conversation
|
@ishpaul777 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] |
There was a problem hiding this comment.
can you clarify why do we have these changes? this might cause regressions on ios Native
There was a problem hiding this comment.
It's because setting the cursor imperatively is what's causing the bug and, in general, declarative is how you should use these props. As you mentioned here the bug that made us use imperative handling in the first place doesn't seem to be present anymore.
There was a problem hiding this comment.
sorry but i didn't interpret this from you proposal, i thought we were just going to pass selection prop in and tested that only while checking proposal surprisingly that only seems to working, but since we are removing this also I'll test this more and get back ASAP!
There was a problem hiding this comment.
Are you talking about the changes regarding removing the imperative handling? If so, I think that was my mistake actually, I forgot to mention we should also remove it, sorry about that. I think removing the imperative handling is better since we don't need it anymore, but we can try just passing the prop and not removing the other code, I'm pretty sure both ways work at the moment.
There was a problem hiding this comment.
so i noticed a bug when randomly putting cursor it adds random spaces in between
Screen.Recording.2025-09-01.at.12.15.57.AM.mov
There was a problem hiding this comment.
ok so i checked that this is reproducible on main as well, and only reproducible on Hybrid app so i guess not related to the PR, will continue testing
There was a problem hiding this comment.
@LorenzoBloedow i have founce another bug while testing this on IOS it seems when adding a emoji from keyboard there is no space added at end while it did add on main
main:
Screen.Recording.2025-09-28.at.1.24.01.AM.mov
this branch:
Screen.Recording.2025-09-28.at.1.26.11.AM.mov
There was a problem hiding this comment.
also it would be very much appreciate if we can track blame history and list all issue for which this imperative handling is added or modified and test each one to make sure its not reproducible anymore, Thanks!
There was a problem hiding this comment.
I'm testing without removing the imperative handling.
|
@LorenzoBloedow bump^ |
|
@ishpaul777 Sorry for the delay, just answered your question above. |
|
not able to priortize but this is still on my radar |
|
Will priortize testing this weekend |
|
@ishpaul777 Bump |
|
sorry @LorenzoBloedow this somehow got disappeared from my k2 dashboard, i have this on list now. Sorry for delay |
|
@ishpaul777 I'm trying a new approach of overriding the selection when suggestions are used, let me know if you find any bugs, I tested it and looks like it works: Screen.Recording.2025-10-07.at.3.25.03.PM.mov |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
|
@LorenzoBloedow Can you please fix conflict, and add some details of new approach like detailed RCA and solution explaination ? |
|
@LorenzoBloedow any updates here? |
|
@ishpaul777 Sorry for the delay 😬, I've been really busy recently. I just fixed the conflicts and tested everything is still working as expected. Also tried to add more detailed explanation of the changes. |
|
@LorenzoBloedow Selecting a name from the suggestions list fails with an error as seen in the screenshot below. I also get the following error when trying to access a session where I am already logged in. Could you check these? |
…uggestions box on web
|
@akinwale Hi, thanks for catching these! Screen.Recording.2025-11-09.at.6.28.25.PM.movScreen.Recording.2025-11-09.at.6.32.00.PM.mov |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp67720-android-hybrid.mp4Android: mWeb Chrome67720-android-chrome.mp4iOS: HybridApp67720-ios-hybrid.mp4iOS: mWeb Safari67720-ios-safari.mp4MacOS: Chrome / Safari67720-web.mp4MacOS: Desktop67720-desktop.mp4 |
|
✋ 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/chiragsalian in version: 9.2.49-0 🚀
|
1 similar comment
|
🚀 Deployed to staging by https://github.com/chiragsalian in version: 9.2.49-0 🚀
|
|
🚀 Deployed to staging by https://github.com/chiragsalian in version: 9.2.52-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.2.54-1 🚀
|
|
🚀 Deployed to staging by https://github.com/chiragsalian in version: 9.2.52-0 🚀
|


Explanation of Change
We're removing the old logic for syncing text selection when the user selects a contact suggestion and using a new approach which overrides the cursor position with the end position of the suggestion because the old method was not correctly computing the end position.
This aligns with the expected behavior of the cursor being positioned at the end of a mention.
Fixed Issues
$ #61944
PROPOSAL: #61944 (comment)
Tests
Prerequisite:
Offline tests
Same as tests.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android.-.App.mov
Android: mWeb Chrome
Android.-.Chrome.mov
iOS: Native
iOS.-.App.mov
iOS: mWeb Safari
iOS.-.Safari.mov
MacOS: Chrome / Safari
macOS.-.Safari.mov
MacOS: Desktop
macOS.-.Desktop.mov