-
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: App crashes after pressing Backspace/Delete key in Incorrect magic code page #23734
Conversation
setFocusedIndex(updatedFocusedIndex); | ||
setInput(value); | ||
inputRefs.current[updatedFocusedIndex].focus(); |
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.
We used to set the input to value
but with this change we won't, the focus method will set the input to an empty string. This does not seem right. Can you please fix this
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 intentionally take out the value bcoz I think we need to reset it once the value has been given for the input box. Its impact can be seen in the last input box where the focusedIndex isn't changing if the full code isn't Fulfilled.
Screen.Recording.2023-07-28.at.12.27.09.AM.mp4
src/components/MagicCodeInput.js
Outdated
@@ -120,9 +119,6 @@ function MagicCodeInput(props) { | |||
focusMagicCodeInput(); |
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.
This will set the input to an empty string. I think we can remove the resetFocus method now as it's same as focus
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.
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 think I agree that we don't need an extra method now, I just committed the changes.
Reviewer Checklist
Screenshots/VideosWebweb.mp4Mobile Web - Chromemweb-chrome.mp4Mobile Web - Safarimweb-safari.mp4Desktopdesktop.mp4iOSios.mp4Androidandroid.mp4 |
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! 🚀
✋ 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/hayata-suenaga in version: 1.3.48-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.48-5 🚀
|
🚀 Deployed to staging by https://github.com/hayata-suenaga in version: 1.3.49-0 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.49-3 🚀
|
Details
Instead of updating the indexes(focused) in
onPress
we used it in theonFocus
to prevent inconsistency in the focused textInput and focused index.Fixed Issues
$ #23596
PROPOSAL: #23596 (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-07-27.at.7.29.14.PM.mp4
Mobile Web - Chrome
anchrome.mp4
Mobile Web - Safari
Simulator.Screen.Recording.-.iPhone.14.-.2023-07-27.at.19.51.34.mp4
Desktop
Screen.Recording.2023-07-27.at.7.48.12.PM.mp4
iOS
Simulator.Screen.Recording.-.iPhone.14.-.2023-07-27.at.19.50.04.mp4
Android
android.mp4