Skip to content

Commit 0c1f53d

Browse files
committed
fix(Input): warning about failed setting prop size on input element
1 parent cddaf8c commit 0c1f53d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/input/Input.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { useInjectFormItemContext } from '../form/FormItemContext';
1919
import omit from '../_util/omit';
2020
import useConfigInject from '../_util/hooks/useConfigInject';
2121
import type { ChangeEvent, FocusEventHandler } from '../_util/EventInterface';
22+
import { omitBy, isUndefined } from 'lodash-es';
2223

2324
export function fixControlledValue(value: string | number) {
2425
if (typeof value === 'undefined' || value === null) {
@@ -309,7 +310,7 @@ export default defineComponent({
309310
if (!inputProps.autofocus) {
310311
delete inputProps.autofocus;
311312
}
312-
const inputNode = <input {...inputProps} />;
313+
const inputNode = <input {...omitBy(inputProps, isUndefined)} />;
313314
return withDirectives(inputNode as VNode, [[antInputDirective]]);
314315
};
315316

0 commit comments

Comments
 (0)