youzan / vant

A lightweight, customizable Vue UI library for mobile web apps.
https://vant.pro/vant/
MIT License
23.22k stars 9.49k forks source link

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

Open kien-ht opened 8 months ago

kien-ht commented 8 months ago

重现链接

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 commented 8 months ago

You can try using the digit type.

kien-ht commented 8 months ago

The digit type doesn’t allow decimals, does it? I need decimals

On Wed, 24 Jan 2024 at 16:45 inottn @.***> wrote:

You can try using the digit type.

— Reply to this email directly, view it on GitHub https://github.com/youzan/vant/issues/12594#issuecomment-1907767415, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARA5MVNS4ZL3GVERP2JSGXDYQDJZXAVCNFSM6AAAAABCIMAIZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBXG43DONBRGU . You are receiving this because you authored the thread.Message ID: @.***>

inottn commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 4 months ago

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)