Preventing brief occurrences of emojis and non-digit chars.#65006
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
|
@aadil42 I don't think we are controlling the Screen.Recording.2025-06-26.at.11.45.57.movCan you reproduce this in this PR as well? Thanks. |
|
@brunovjk How stupid of me. I found the issue. The reason it was working in the other PR is because we were passing
I removed that part because github action was yelling at me for passing a boolean value as shown in the image above. So I removed it. But yes it is because of this that we don't have default values anymore because it becomes undefined when we don't pass This code is what is making App/src/components/Form/FormProvider.tsx Lines 364 to 367 in a51e02b |
|
Default value for |
|
I'm a bit busy with another PR, I'll be back here soon. |
|
Ok @brunovjk |
|
Sorry for the delay @aadil42, I was busy with another PR, but you are doing a great job here.
You can keep the input uncontrolled by passing the prop name without a value: What do you think? Thank you |
|
@brunovjk, This does work I thought it would make Screen.Recording.2025-07-01.at.2.mp4This I think is happening because of the This is what we're gonna do:Instead of using We're adding custom chars that allows specific chars and we're making it optional so we can also omit negative sign when typing positive value when positive and negative both are allowed. const customNotationForMask = [{
character: '@',
characterSet: '0123456789.-',
isOptional: true,
}];dynamic masking based on shouldAllowNegative prop. mask={shouldAllowNegative ? `[@][99999999]${separator}[09]`: `[09999999]${separator}[09]`}The reason for finally adding customNotations prop customNotations={customNotationForMask}We can have other char instead of I apologize for the delay and for myriad of little bugs. video of working solution.Screen.Recording.2025-07-01.at.5.mp4 |
|
Looking good @aadil42! I'm totally fine with I think it’s important to include a comment in the code explaining that this character is used to enable optional negative values in the mask logic. Everything else looks good! I just need a bit more time for broader testing and regression checks. Great job so far! |
|
@brunovjk, yeah I think we can use |
|
@brunovjk, using |
|
@brunovjk, I hope we can merge the PR today. 🙂 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp65006_android_native.movAndroid: mWeb Chrome65006_android_web.moviOS: HybridApp65006_ios_native.moviOS: mWeb Safari65006_ios_web.movMacOS: Chrome / Safari65006_web_chrome.movMacOS: Desktop65006_web_esktop.mov |
amyevans
left a comment
There was a problem hiding this comment.
This is looking great, thank you both for sticking with it diligently!
2 quick things -
- It looks like there are conflicts in
src/pages/workspace/perDiem/EditPerDiemAmountPage.tsx, please resolve - Let's add as a last step to the
TestssectionVerify the alphabet/emoji does not show(so that it is clear what the expected behavior is)
|
@aadil42 they were just asking you to update this PR description with one more item :D
But I don't think it's correct, since we can open the emoji keyboard as well as the alphabetic keyboard, the point is that we shouldn't be able to type an emoji or letter, as we guarantee in this PR. What do you think? Thanks. cc: @amyevans |
|
Great! But I think you can add these step here anyway. If they disagree, we would change it to what they suggested. What do you think? |
|
Sorry for the delay! And yes, your suggestion for the adjusted test steps looks great. Thank you! |
|
The ESLint and Prettier checks are failing. Are you able to see the output in the GH Actions run or would it be helpful if I screenshotted? |
|
I'll also look into Prettier check. |
|
@brunovjk, @amyevans this is the gist of why the checks were failing. in AmountWithoutCurrencyInput for some reason the variable in EditPerDiemAmountPage we had to pass And lastly we just had to run |
|
✋ 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/amyevans in version: 9.1.78-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.1.78-4 🚀
|
|
Nope, it's not due to the changes here! You can see the same was commented on other PRs (e.g. #65551 (comment)). It just means there was a problem with automatically submitting the version to the App Store, we got a notification about it internally in Slack, and one of our deployers manually submitted to the App Store. So nothing to worry about! |
|
@aadil42 I asked internally and you should have gained access just now. Let me know if not. Thanks! |
|
@amyevans No I haven't received any email. I'm not yet added. |
|
Yes. I got in by re-logging. Thank you so much @amyevans! |
|
You're welcome! |





Explanation of Change
Using
AmountWithoutCurrencyInputbecause it's already usingreact-native-advanced-input-maskto prevent brief occurrences of emojis and non-digits chars.Adding logic in
AmountWithoutCurrencyInputto allow negative values.Removing
AmountWithoutCurrencyFormAs it's not being used anywhere in codebase anymore.Fixed Issues
$ #63127
PROPOSAL: #63127(comment)
Tests
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))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-native-test.mp4
Android: mWeb Chrome
android.mweb.test.mp4
iOS: Native
ios.native.test.mp4
iOS: mWeb Safari
ios.mweb.test.mp4
MacOS: Chrome / Safari
web.chrome.mp4
MacOS: Desktop
mac.os.desktop.mp4