B
B
bpGusar2019-02-14 13:19:09
JavaScript
bpGusar, 2019-02-14 13:19:09

Why is Chrome forcibly changing dot to comma in input number And how to fix it?

The problem, in my case, applies only to React, because when you do such an input

<input
  type='number'
  defaultValue="0.5"
/>

when loading the page, there will be a comma in the input, but a dot is needed.
Is it possible to somehow defeat this behavior of the input, which appears only in chrome?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitrij Shovery, 2019-02-14
@Shovery

Chrome uses to display the user's locale setting. In the CIS countries, a comma is used. To display a point, you need to use the pattern for the input tag
Why should type="text" be used? The number type cannot be patterned without using JS, as far as I know.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question