-
-
Notifications
You must be signed in to change notification settings - Fork 46.7k
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
AutoComplete does not work if added as part of a functional component to Form (e.g. within Steps) #39473
Comments
"So in order to create the multi step form several of these functional components would be added to the list." This is an example of a multi-step form with such functional components, but without AutoComplete, to make my setup clearer: https://codesandbox.io/s/cool-mcnulty-or8jw?file=/src/MyStepForm.js |
You defined solution:
|
@YinDongFang You are right, it is not a bug, but my fault. Thanks for explaining. I would still be interested why you recommended step 2? It seems to work also with the style: https://codesandbox.io/s/antd-reproduction-template-forked-m8zimd?file=/index.js |
You should pass |
sorry. It's not two steps but two ways to resolve your problem. |
Reproduction link
Steps to reproduce
What is expected?
When typing letters into the AutoComplete field, a list of options as a dropdown is expected
What is actually happening?
No options are displayed
This problem occurs only when adding to the Form as a functional component. This scenario occurred for me within a multi-step form as part of a modal. When using Steps as shown within antd documentation contents of the steps is added to a list, e.g. shown here https://ant.design/components/steps#components-steps-demo-step-next So in order to create the multi step form several of these functional components would be added to the list.
Maybe related #27115 (#27115)
Please excuse if adding functional components within a functional component like shown in the codebox is an anti-pattern. I could not find evidence for this. Maybe it would also be an interesting example for documentation of the Steps component as multi step Form seems to be a common use case.
The text was updated successfully, but these errors were encountered: