-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
Version
3.1.0
Environment
antdv 3.1.1
Reproduction link
Steps to reproduce
ant-design-vue/components/input/Input.tsx
Lines 286 to 313 in cddaf8c
| const inputProps = { | |
| ...otherProps, | |
| ...attrs, | |
| autocomplete: autocomplete.value, | |
| onChange: handleChange, | |
| onInput: handleChange, | |
| onFocus, | |
| onBlur, | |
| onKeydown: handleKeyDown, | |
| class: classNames( | |
| getInputClassName(prefixCls.value, bordered, size.value, disabled, direction.value), | |
| { | |
| [attrs.class as string]: attrs.class && !addonBefore && !addonAfter, | |
| }, | |
| ), | |
| ref: inputRef, | |
| key: 'ant-input', | |
| size: htmlSize, | |
| id: otherProps.id ?? formItemContext.id.value, | |
| }; | |
| if (valueModifiers.lazy) { | |
| delete inputProps.onInput; | |
| } | |
| if (!inputProps.autofocus) { | |
| delete inputProps.autofocus; | |
| } | |
| const inputNode = <input {...inputProps} />; | |
| return withDirectives(inputNode as VNode, [[antInputDirective]]); |
If inputProps.size is a false value, like 0, null, undefined,
and pass it to <input {...inputProps} />.
A warning appears.
[Vue warn]: Failed setting prop "size" on : value 0 is invalid. DOMException: Failed to set the 'size' property on 'HTMLInputElement': The value provided is 0, which is an invalid size.
What is expected?
do not warning.
What is actually happening?
[Vue warn]: Failed setting prop "size" on : value 0 is invalid. DOMException: Failed to set the 'size' property on 'HTMLInputElement': The value provided is 0, which is an invalid size.