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

[BUG] Form 组件在 strict & development 下调用 validate() 没有返回 #2210

Closed
1 task done
nekocode opened this issue Apr 29, 2024 · 1 comment · Fixed by #2211
Closed
1 task done

[BUG] Form 组件在 strict & development 下调用 validate() 没有返回 #2210

nekocode opened this issue Apr 29, 2024 · 1 comment · Fixed by #2211

Comments

@nekocode
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Which Component

Form

Semi Version

2.57.0

Current Behavior

在 strict & development 下调用 formApi.validate() 没有返回/反应

Expected Behavior

正常展示错误提示

Steps To Reproduce

No response

ReproducibleCode

No response

Environment

- OS: MacOS
- browser: Chrome

Anything else?

No response

nekocode added a commit to nekocode/semi-design that referenced this issue Apr 29, 2024
@nekocode
Copy link
Contributor Author

经 debug 发现是在:

if (isUnmounted.current || validatePromise.current !== rootPromise) {
这里 isUnmounted 返回 true 导致的。在 strict & development 下 useEffect 会调用两次,所以需要在 usEffect 里重置标志。具体可以看这个 PR: https://github.com/DouyinFE/semi-design/pull/2211/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant