-
Notifications
You must be signed in to change notification settings - Fork 33
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
Also accept , as . in input fields that accept decimals #114
Comments
So on your phone, it uses ',' instead of '.'? Why does everyone in the whole world have to be so different? ;) @gb0101010101, the number input fields have that inputmode/pattern thing added to it that you did. Any idea on how to overcome this? |
As I said, IMHO it is easier to "normalize" from |
The input field probably uses "decimal" (see examples https://css-tricks.com/everything-you-ever-wanted-to-know-about-inputmode/). But the decimal sign is based on the locale settings of the device (so it is a You could go for "numeric", but on iOS that's actually a much worse keyboard, than what you get with "decimal". So replacing the |
Probably a Okay, the |
@madgrizzle, I will check this out. It should not be too difficult. AFAIK Android and iOS automatically react to the number input so it's probably the regex that only needs fixing. |
FYI, this is not going to be easy as it is not really implemented in browser form input validation. I also cannot find any Regex that will work well without creating new problems. Basically need to do validation in JavaScript. Found Globalize JS which has:
This is client side validation only. Server side would keep using standard parseFloat() and expect all numbers to be decimal using period (.) as separator for all locales. |
@gb0101010101 I mean, having an input field in the frontend for a Maslow with a decimal bigger than 1000 is already a total edge case. We are talking about daily usage via a smartphone, so the interesting input field here are the Z axis (where I had the problem) and the travel distance (where I would never enter a decimal number, because travel moves so precise aren't needed. And it's over the precision of the machine in most cases anyway). In both, especially in inch mode, you will not enter numbers so big. Second, having a user entering a decimal over 1000 as e.g. 1,478.342, so with I'm (and probably all other users) are totally okay with entering decimal with a So long story short, an added |
Fixed in PR #130. |
When I use WebControl on my phone I'm not able to add numbers with decimals, because my language setting is on German and the normal decimal sign here is
,
. If I answer a number with decimals, simply nothing happens, when I press the button afterwards (e.g. in the Z-axis sub-window).I see two ways to fix this:
,
by.
in the Javascript "backend" code (assuming here, that no user will enter stuff like e.g. "2,040.500" normally)The text was updated successfully, but these errors were encountered: