-
-
Notifications
You must be signed in to change notification settings - Fork 124
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: Update input to empty string when userValue
is undefined
#323
Conversation
@@ -104,9 +104,9 @@ export const CurrencyInput: FC<CurrencyInputProps> = forwardRef< | |||
}; | |||
|
|||
const formattedStateValue = | |||
defaultValue !== undefined && defaultValue !== null | |||
defaultValue != null |
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 is just a clean-up. The double-equal null logic is equivalent to checking for null
and undefined
. It makes the code more concise.
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.
Interesting, I did not know that!
Although, I personally would prefer to be explicit rather than concise, so I was tempted to say keep it as is, but since all the tests passed anyway, I thought that's good enough for me :D
userValue
is undefined
@cchanxzy do you have time to take a look at this PR and the issue it attempts to fix? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #323 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 410 411 +1
Branches 161 159 -2
=========================================
+ Hits 410 411 +1 ☔ View full report in Codecov by Sentry. |
Thanks for the contribution and fix @aconrad ! |
## [3.6.13](v3.6.12...v3.6.13) (2023-12-28) ### Bug Fixes * Update input to empty string when `userValue` is `undefined` ([#323](#323)) ([30c5fcc](30c5fcc))
🎉 This PR is included in version 3.6.13 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #322.
I'm unsure if that's the correct approach, but all tests pass, including the ones I added that weren't passing before the fix.