Skip to content

Warning about the Input component #5504

New issue

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

Closed
1 task done
wvq opened this issue Apr 15, 2022 · 3 comments
Closed
1 task done

Warning about the Input component #5504

wvq opened this issue Apr 15, 2022 · 3 comments
Labels

Comments

@wvq
Copy link

wvq commented Apr 15, 2022

  • 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

Edit on CodeSandbox

Steps to reproduce

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.

@tangjinzhou
Copy link
Member

size only support large default small

@ayizhi
Copy link

ayizhi commented Apr 16, 2022

size only support large default small

don't close 😂
I get this problem as well, if not set the "size" attr of a-input, this warning would be ejected.
on the case of ant-design-vue is required by "script" or webpack external
but there should be default value of a-input
hope for fixed, thx for creating this remarkable ui component project

this issue is not on 3.1.0 rc.5, btw

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants