-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Enhancement: Introduce formatValueOnBlur Flag #339
Conversation
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 @@
## main #339 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 411 412 +1
Branches 154 160 +6
=========================================
+ Hits 411 412 +1 ☔ View full report in Codecov by Sentry. |
Hi @Contraboi, can you give me a use case on why this is a feature you want to add? Thanks |
@cchanxzy I can give you a use case that I'm running into. I am using the currency input in a filter drawer. I've notice that if I enter a value, let's say |
Hi @cchanxzy, sorry for late response. My use case involves complex calculations where multiple fields depend on each other. I did not want to format the value on blur because that could lead to unexpected behavior. I believe that, in general, there needs to be a flag to disable formatting values on blur. This is not intuitive, as input fields typically operate on button click or change, rather than on blur. |
Indeed, I was very surprised when I realized the onValueChange event runs after the onBlur. That is not expected behavior. After reviewing the code I've realized that as a work-around I can use the |
# [3.8.0](v3.7.1...v3.8.0) (2024-02-22) ### Features * introduce formatValueOnBlur flag ([#339](#339)) ([5e30154](5e30154))
🎉 This PR is included in version 3.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Merged! Thanks @Contraboi for your PR! |
This pull request introduces the formatValueOnBlur flag, allowing users to customize the behavior of the onValueChange function on blur events. The default behavior is set to true, ensuring no disruption to the current production code.