-
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
fix: handle forward-delete properly in the amount text input #25815
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@narefyev91 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] |
I had to refactor This led to the issue outlined in the steps below.
Since the issue that the mentioned PR fixes only happens on Android, and the related proposal mentioned creating an Android-platform specific file, I have gone ahead to do this in this PR so that other platforms can work as expected. Forward-delete is a no-op on Android, so this regression will never happen on Android even with a hardware keyboard connected (Delete key presses are not recognised). |
@akinwale can you please sync your fork with latest main and also update branch and double check that code is still working |
@narefyev91 Done. Tested OK on all platforms. I also added iOS for the Control-D shortcut, because it's possible to connect a hardware keyboard to an iPhone or an iPad, and the keyboard shortcut is recognised as forward-delete. |
@akinwale can you please check ios-web Screen.Recording.2023-08-24.at.15.42.07.mov |
@narefyev91 This seems to be a weird edge-case with the way iOS Safari handles the Control key for the keyboard shortcut. I have pushed a new commit with a specific fix for this. Everything tests OK on other platforms with this change. |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Safariios-web.movDesktopdesktop.moviOSios.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! Nice and complex finding!
🎀 👀 🎀 C+ reviewed
*/ | ||
const textInputKeyPress = ({nativeEvent}) => { | ||
const key = nativeEvent.key.toLowerCase(); | ||
if (Browser.isMobileSafari() && key === 'control') { |
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.
'control'
-> CONST.PLATFORM_SPECIFIC_KEYS.CTRL.DEFAULT
?
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.
Makes sense. I've seen these key constants in the past, but then I forgot all about them. It's fixed now.
Retested on all platforms OK after fixing the merge conflict. |
@marcaaron Bump on review. I have fixed additional merge conflicts and cleaned up DRY issues with the code. I have also tested again on all platforms, after the modifications, to make sure that everything works as expected. Thanks. |
Fixed another merge conflict and retested on all platforms. At least, we're all synced with the latest main now. |
✋ 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/marcaaron in version: 1.3.59-0 🚀
|
🚀 Deployed to staging by https://github.com/marcaaron in version: 1.3.60-0 🚀
|
🚀 Deployed to staging by https://github.com/marcaaron in version: 1.3.60-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.59-5 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.60-3 🚀
|
Details
Forward-delete in the text input means deleting text to the right hand side of the current cursor placement. This PR fixes the issue with the cursor jumping around when a forward-delete operation occurs.
Additional notes regarding the
TextInputWithCurrencySymbol
refactor will be posted below.Fixed Issues
$ #25578
PROPOSAL: #25578 (comment)
Tests
Offline tests
N/A
QA Steps
Same as tests.
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
25578-web.mp4
Mobile Web - Chrome
Mobile Web - Safari
Desktop
25578-desktop.mp4
iOS
Android