Replies: 1 comment 1 reply
-
Interesting ideas @Heziode. This feels like something that should be built on top of the machine, not built in. Could you share some examples of how you achieved those? Perhaps we could document them |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, thank you for this project, very useful to not reinvent the wheel 🎉
🚀 Feature request
Two features:
🧱 Problem Statement / Justification
Simple Math
For example, if we have a form with severals Number Input, that is persisted (local storage, backend, etc.), and we have a value, like 10883, it could be useful to do something like
10883+117
and to get 11000 for the value of the input when we leave the field or press Enter.This could be very useful for financial stuff or form with big number logic.
Remove zero on focus
This is UX so that the user doesn't have to remove the 0 himself if he wants to enter a value.
✅ Proposed solution or API
Add something like this in the machine API:
Techincal details
For security, use the Mathjs > evaluate function (or similar) to prevent malicious or erroneous user input. This is what I have done in my current implementation (currently closed source).
↩️ Alternatives
Custom component based on Chakra Number Input
📝 Additional Information
Video of "simple math":
CleanShot.2024-06-14.at.22.18.14.mp4
Video of "remove initial 0 value on focus" :
CleanShot.2024-06-14.at.22.13.38.mp4
Beta Was this translation helpful? Give feedback.
All reactions