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

Add built-in loading indicator for Form #34768

Closed
csandanov opened this issue Mar 29, 2022 · 8 comments · Fixed by react-component/field-form#397 or #34845
Closed

Add built-in loading indicator for Form #34768

csandanov opened this issue Mar 29, 2022 · 8 comments · Fixed by react-component/field-form#397 or #34845
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@csandanov
Copy link

csandanov commented Mar 29, 2022

What problem does this feature solve?

  • blocking all inputs after submit button was clicked
  • showing a message for a user, e.g. "Validating creation...", "Submitting your application..."
  • I'm currently using the approach where I wrap a form with <Spin> but this create issues, see this example, when you submit the form you will see the input's value showing the default value from initialValues of the input instead of the one being submitted

What does the proposed API look like?

<Form loading={submitted} />

@github-actions
Copy link
Contributor

github-actions bot commented Mar 29, 2022

You may look for issues:

  1. 52% Add support for 'yearCellRender' to DatePicker #33922

🤖 By issues-similarity-analysis

@afc163
Copy link
Member

afc163 commented Mar 30, 2022

https://codesandbox.io/s/antd-reproduction-template-forked-vbkbic?file=/index.js

We need to dig why Form render initialValues after Spin is shown.

@afc163 afc163 added 🐛 Bug Ant Design Team had proved that this is a bug. and removed 💡 Feature Request labels Mar 30, 2022
@afc163
Copy link
Member

afc163 commented Mar 30, 2022

@MadCcc
Copy link
Member

MadCcc commented Apr 1, 2022

https://codesandbox.io/s/antd-reproduction-template-forked-c40zwu
Try to use spinning to control loading? Change of DOM make Form mount again and return to initial state.

@csandanov
Copy link
Author

that's a very elegant solution, thank you
but adding spinning/loading to Form itself would be even more cool

@MadCcc
Copy link
Member

MadCcc commented Apr 1, 2022

It's still a bug since form is used to control form values. We'll try to fix it.

@zombieJ
Copy link
Member

zombieJ commented Apr 1, 2022

ref #33981

@vitalijalbu
Copy link

I also want this feature, like card does.. simply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
5 participants