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

[Bug Report] van-field type=number not allow decimal points in iOS devices #12594

Open
kien-ht opened this issue Jan 24, 2024 · 6 comments
Open

Comments

@kien-ht
Copy link

kien-ht commented Jan 24, 2024

重现链接

https://vant-ui.github.io/vant/#/en-US/field

Vant 版本

latest

描述一下你遇到的问题。

It does bring up the numeric keyboard, however decimal points are not allowed/clickable.

It actually works on Chrome 117.0.5938.155/ Android, but not in any browsers in iOS.

重现步骤

  1. Go to https://vant-ui.github.io/vant/#/en-US/field
  2. Look for "Custom Type" demo
  3. Type in "Number" field

设备/浏览器

Safari/iOS 16.7.4, Chrome 117.0.5938.117/iOS

@inottn
Copy link
Collaborator

inottn commented Jan 24, 2024

You can try using the digit type.

@kien-ht
Copy link
Author

kien-ht commented Jan 24, 2024 via email

@inottn
Copy link
Collaborator

inottn commented Jan 24, 2024

Sorry, I misunderstood. However, I haven't been able to reproduce this issue on iOS 14 and 15. Could you please provide a screenshot?

@kien-ht
Copy link
Author

kien-ht commented Jan 24, 2024

image

You see the red circle. I assume it is for decimal points, but somehow it's not working in my mobile Safari (iOS 17.1.2), although it seems to work in Chrome

@Jungzl
Copy link
Contributor

Jungzl commented Jan 31, 2024

Some regions like France use comma as their decimal mark by default, you can still choose decimal point style number format by SettingsLanguage & RegionNumber Format.

Vant side can't do anything for it. That's what you can expect as a native <input type="number">, maybe there will be a document mentioned about it.

@vitto32
Copy link

vitto32 commented May 21, 2024

A native <input type="number"> shows the value with the comma to the user (15,10) and returns 15.10.

The ISO standard says:

the symbol for the decimal marker shall be either the point on the line or the comma on the line

The dot is vastly used outside USA and China (https://en.wikipedia.org/wiki/Decimal_separator#/media/File:DecimalSeparator.svg)

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

4 participants