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

[InputNumber] 特定情况下,聚焦和失焦时的数值不一致 #4148

Open
Mophar-gift opened this issue Apr 25, 2024 · 2 comments
Open

Comments

@Mophar-gift
Copy link

tdesign-vue-next 版本

latest

重现链接

https://stackblitz.com/edit/nvyqbp?file=src%2Fdemo.vue

重现步骤

  1. 使用inputNumber组件
  2. 设置属性
    decimalPlaces: 2;
    max: 999999999999999;
    allowInputOverLimit: false;
  3. 输入123456789012341.44
    失焦后:123456789012341.45
    聚焦时:恢复正常
  4. 输入123456789012341.1
    失焦后:123456789012341.09
    聚焦时:恢复正常

....等等,可以换小数点后的数值进行尝试,有的正常,有的会变。

期望结果

输入值正常,不论聚焦还是失焦都应该保持正常,不会自动被四舍五入等改变

实际结果

聚焦时与失焦时值会自动改变

框架版本

Vue(3.4.21)

浏览器版本

No response

系统版本

win11

Node版本

20.9.0

补充说明

No response

Copy link
Contributor

👋 @Mophar-gift,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@novlan1
Copy link
Contributor

novlan1 commented May 28, 2024

是 js 自身的精度问题,通过控制台就可以复现
image

可以改成 largeNumber

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants