mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
fix: input not support number value (#33462)
This commit is contained in:
parent
c6188fd388
commit
0c621c4832
@ -65,7 +65,7 @@ export function fixControlledValue<T>(value: T) {
|
||||
if (typeof value === 'undefined' || value === null) {
|
||||
return '';
|
||||
}
|
||||
return value;
|
||||
return String(value);
|
||||
}
|
||||
|
||||
export function resolveOnChange<E extends HTMLInputElement | HTMLTextAreaElement>(
|
||||
|
@ -298,4 +298,9 @@ describe('Input allowClear', () => {
|
||||
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('not crash when value is number', () => {
|
||||
const wrapper = mount(<Input suffix="Bamboo" value={1} />);
|
||||
expect(wrapper).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user