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

fix(form): 修复openChange打开时不触发问题 #8403

Merged
merged 2 commits into from May 23, 2024

Conversation

beautiful-boyyy
Copy link
Contributor

如果ModalForm的open状态由父级通过props控制,并且需要在打开时对form设定初值,就需要监听propOpen的状态,并在其为 true时执行一次onOpenChange。

Copy link

⚡️ Deploying PR Preview...

@leshalv
Copy link
Contributor

leshalv commented May 10, 2024

@zhuba-Ahhh

@beautiful-boyyy
Copy link
Contributor Author

beautiful-boyyy commented May 10, 2024

一般一个modaforml默认都是不打开的,当他的open=true时,其实就隐含了一次change

@chenshuai2144 chenshuai2144 changed the title 修复openChange打开时不触发问题 fix(form): 修复openChange打开时不触发问题 May 20, 2024
@chenshuai2144
Copy link
Contributor

这样有可能触发两次呢,你是什么场景?

@leshalv
Copy link
Contributor

leshalv commented May 20, 2024

这样有可能触发两次呢,你是什么场景?

外部控制open情况,我也遇到了,改了一个遍

@beautiful-boyyy
Copy link
Contributor Author

这样有可能触发两次呢,你是什么场景?

通过props控制open的场景。另外,触发两次我觉得是符合逻辑的,打开一次,关闭一次,因为一般来说modalform默认都是不打开的,或者再加一个属性,控制打开的时候是否执行onOpenChange.

@asd116725
Copy link

大佬们,抓紧时间合一下,炸了不能用,只能倒退版本了。

@chenshuai2144 chenshuai2144 merged commit 5a1153b into ant-design:master May 23, 2024
10 checks passed
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 this pull request may close these issues.

None yet

4 participants