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] submitButtonProps = false不生效, 提交按钮还是会显示 #8648

Open
roddc opened this issue Aug 14, 2024 · 1 comment
Open

Comments

@roddc
Copy link

roddc commented Aug 14, 2024

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🐛 bug 描述

设置submitButtonProps为false没有效果, resetButtonProps为false是会生效的

 return (
      <Submitter
        key="submitter"
        {...submitterProps}
        onReset={() => {
          const finalValues = transformKey(
            formRef.current?.getFieldsValue(),
            omitNil,
          );
          submitterProps?.onReset?.(finalValues);
          onReset?.(finalValues);
          // 如果 syncToUrl,清空一下数据
          if (syncToUrl) {
            // 把没有的值设置为未定义可以删掉 url 的参数
            const params = Object.keys(
              transformKey(formRef.current?.getFieldsValue(), false),
            ).reduce((pre, next) => {
              return {
                ...pre,
                [next]: finalValues[next] || undefined,
              };
            }, extraUrlParams);

            /** 在同步到 url 上时对参数进行转化 */
            onUrlSearchChange(genParams(syncToUrl, params || {}, 'set'));
          }
        }}
// 这里重写了submitButtonProps导致为false不生效
        submitButtonProps={{
          loading,
          ...submitterProps.submitButtonProps,
        }}
      />
    );

📷 复现步骤

🏞 期望结果

submitButtonProps为false时隐藏

💻 复现代码

© 版本信息

  • ProComponents 版本: 2.7.14
  • umi 版本
  • 浏览器环境
  • 开发环境 [e.g. mac OS]

🚑 其他信息

@xuchaoying
Copy link

什么时候修复呀

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

No branches or pull requests

2 participants