Skip to content
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

Proposal to Improve the Manipulation of Masked Field Values in Forms #37

Closed
kurybr opened this issue May 12, 2024 · 2 comments
Closed

Comments

@kurybr
Copy link

kurybr commented May 12, 2024

It would be good to have a way to manipulate the value of the field, for example, fields that use masks (like currency) are bringing the complete string "USD$ 100.32".

Just as we have the filterInput function, there could be something that iterates between the fields and allows us to manipulate the field's return; it would give much more flexibility to the developer.

This way, I could take the field that has the mask and process the value to return it as a number "100.32".

@kurybr kurybr changed the title A method to format value of field Proposal to Improve the Manipulation of Masked Field Values in Forms May 12, 2024
@kurybr
Copy link
Author

kurybr commented May 12, 2024

I create a suggestion

#38

@brainfoolong
Copy link
Owner

Hey. Thanks for the suggestion. Unfortunately, manipulating returned form data on the fly is not in scope for this library. It adds more complexity for a very niche feature. Futhermore, it will make the library be able to return data that is incompatible with fromJson or even can return data that is not JSON compatible anymore (By returning a function or other data type for example).

The main idea here was to keep the library as simple as possible.

Even the inputFilter was a little mistake to integrate, but this is a legacy feature and cannot be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants