-
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
Fixed moving cursor to end problem except IOUAmountPage #2010
Fixed moving cursor to end problem except IOUAmountPage #2010
Conversation
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 👍
Tested on desktop too, seemed to solve the issues I'm seeing on master |
Hold off on merging this for a second. I'm not sure I agree with the solution here and I want to dig into it a little bit. |
OK, here is my thinking. The This refactoring would make the component much more traditional, but won't solve the problem itself. I actually am not entirely sure what the original problem was. The commit this was introduced was in 65fe5a9 and I would like to get @NikkiWines context about the reason that I'm almost thinking that there should be two separate |
Sorry, I meant to ping @tugbadogan about that previous PR. Could you please see my previous comment and see if you can provide more context around the need for |
Hi @tgolen I added this function to solve an issue where we validate and update text input value from IOUAmountPage. If we don't move cursor to end on component update, cursor stays at the beginning of text input as seen in this video. What do you recommend here as a next step? Screen.Recording.2021-03-23.at.23.52.18.mov |
Whoa, that's weird. What causes that? Is it constantly losing and regaining focus after each key stroke? |
In order to validate the user input and set TextInput value manually with the validated amount, I've added I think this part prevents |
Thanks for more context! I'm digging into it now and I'm starting to see several missteps that lead down this path to an outcome that is less than ideal.
I think that with the validation properly refactored, and coupled with the refactoring of |
For now, I would recommend simply commenting out the |
I removed move cursor to end functionality from TextInputFocusable. Thanks for explanation above. I will refactor the code as you recommended. |
Thank you so much! I wanted to try out the refactoring myself to see if it did indeed work, and it looks like it does work pretty well. You can see just a really rough idea of it here: https://github.com/Expensify/Expensify.cash/compare/tgolen-fix-indent?expand=1 |
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.
I'm gonna approve this so we can merge it and fix the regression in the main report compose field
Anything that should be tested on our side on this PR? CC @tgolen @roryabraham @thienlnam |
Hi @isabelastisser. This should verify that the issue was solved:
(previously, the cursor would jump back to the last input character) |
Hi @Julesssss, you meant to tag @isagoico :) |
🤦 not again, sorry! |
Ahahaha It actually happens a lot 🤣 We're testing this atm |
@johnmlee101
Details
forceMoveCursorToEnd
prop toTextInputFocusable
component.IOUAmountPage
to keep the cursor at the end all the time.Fixed Issues
Fixes #1691
Tests
Tested On
Screenshots
Web
Screen.Recording.2021-03-23.mov