This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #116
This PR creates a
number-input
which sanitizes text to remove characters that are not numbers or a period. For example, if you were to paste "$1,000.00" into a number input it would change the value of the input to "1000.00".With these changes it is now much easier to extend
em-input
and add any sort of sanitization desired in the future.Outstanding Issues:
There are many countries, which use a comma as a decimal mark. This feature has the potential to cause confusion by removing commas which are important to actual value of the number e.g. "$100,00" one hundred dollars becoming "$10000" ten thousand dollars.
Country specific configuration seems like something that may be a frequent issue for an app of this nature. It may be worth spending some time thinking about how to add such a configuration to the system.
cc @HospitalRun/core-maintainers