Closed paranoidjk closed 6 years ago
A
may be better for no break changes.
A still may consider as a break change. `
Only if we make (value: string, rawValue: string) => {}
, which may consider no break change, but i think it's no use, the users still need to know that they should get the second params.
Break change may leave to antd-mobile@3
. This problem is not very emergency.
B
Problem
Right now
InputItem
type
will have impact on the value format, not just the display text format, eg:type="phone"
will got something like"123 1234 5678"
. It may cause extra work when users want to post data to server etc.Proposal
A
Just do a transform with display text, onChange always give a rawValue
(rawValue: string) => {}
B
Add a
formatter & parse
to do all custom display feature. eg: antdInputNumber
:formatter & parse
https://ant.design/components/input-number-cn/#API