Skip to content
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

cannot set Input value when use it with AutoComplete #16589

Closed
1 task done
zhaoo-jing opened this issue May 14, 2019 · 8 comments
Closed
1 task done

cannot set Input value when use it with AutoComplete #16589

zhaoo-jing opened this issue May 14, 2019 · 8 comments
Assignees
Labels
🤔 Need Reproduce We cannot reproduce your problem

Comments

@zhaoo-jing
Copy link

zhaoo-jing commented May 14, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://codesandbox.io/embed/135jzzqvz3

Steps to reproduce

use value and onChange to set Input(inside AutoComplete) value

What is expected?

can set Input value

What is actually happening?

cannot set Input value

Environment Info
antd 3.12.1
React 16.6.3
System win10
Browser chrome74.0.3729.131

want to clear Input value in AutoComplete, use the value property of AutoComplete will cause a problem, which is auto select option when input

@ant-design-bot
Copy link
Contributor

Hello @Zhaojing0987. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 7 days.

你好 @Zhaojing0987, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。7 天内未跟进的 issue 将会被自动关闭。

@afc163 afc163 added the 🤔 Need Reproduce We cannot reproduce your problem label May 14, 2019
@zhaoo-jing
Copy link
Author

image
cannot set Input value and trigger onChange

@zombieJ
Copy link
Member

zombieJ commented May 15, 2019

Do not set value on Input. Set on AutoComplete instead.

@zombieJ zombieJ closed this as completed May 15, 2019
@zhaoo-jing
Copy link
Author

@zombieJ the value property of AutoComplete is to set selected option, if I trigger onChange to change autoComplete value, it will auto select a option, but I just want to change the input value.
for example, when I input "1", it will automatically fill in "value1", which means I cannot search anything start with "1".the moment I input a letter, it auto selected and changed Input value

@zombieJ
Copy link
Member

zombieJ commented May 15, 2019

AutoComplete is set to input value, not force require match the option: https://ant.design/components/auto-complete-cn/#components-auto-complete-demo-non-case-sensitive

@zhaoo-jing
Copy link
Author

@zombieJ it will select option if you set value
image

@zhaoo-jing
Copy link
Author

@zombieJ updated reproduction link

@zombieJ
Copy link
Member

zombieJ commented May 15, 2019

Press ESC to close popup. Option in AutoComplete is optional. It do trigger onChange with user input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 Need Reproduce We cannot reproduce your problem
Projects
None yet
Development

No branches or pull requests

5 participants