We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Form.InputNumber
No response
Form 内 InputNumber 添加如示例代码所示 formatter 和 parser 后,输入值报错。
单独使用 InputNumber 没问题
import React from 'react'; import { Form, Tooltip } from '@douyinfe/semi-ui'; import { IconHelpCircle } from '@douyinfe/semi-icons'; () => { const { Option } = Form.Select; return ( <Form layout='horizontal' onValueChange={values=>console.log(values)}> <Form.Input field='UserName' label='用户名' style={{ width: 80 }}/> <Form.Input field='Password' label={{ text: '密码', extra: <Tooltip content='详情'><IconHelpCircle style={{ color: 'var(--semi-color-text-2)' }}/></Tooltip> }} style={{ width: 176 }} /> <Form.InputNumber formatter={value => { return String(Number(`${value}`.replace(/\D/g, '')) / 60000); }} parser={value => { return String(Number(`${value}`.replace(/\D/g, '')) * 60000); }} min={60000} step={60000} /> <Form.Select field="Role" label={{ text: '角色', optional: true }} style={{ width: 176 }}> <Option value="admin">管理员</Option> <Option value="user">普通用户</Option> <Option value="guest">访客</Option> </Form.Select> </Form> ); };
### Environment ```markdown - OS: - browser:
The text was updated successfully, but these errors were encountered:
fix: fixed InputNumber formatter bug in controlled mode #1672
da0304c
Merge pull request #1767 from DouyinFE/fix/1672
5a24299
v2.42.0-beta.0
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Is there an existing issue for this?
Which Component
Form.InputNumber
Semi Version
No response
Current Behavior
Form 内 InputNumber 添加如示例代码所示 formatter 和 parser 后,输入值报错。
单独使用 InputNumber 没问题
Expected Behavior
No response
Steps To Reproduce
No response
ReproducibleCode
Anything else?
No response
The text was updated successfully, but these errors were encountered: