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]ProTable搜索清空数据前提交beforeSearchSubmit被触发 #8729

Open
godcong opened this issue Sep 14, 2024 · 0 comments
Open

Comments

@godcong
Copy link

godcong commented Sep 14, 2024

提问前先看看:

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

🐛 bug 描述

ProTable搜索
点击[重置]按钮提交搜索时,beforeSearchSubmit被触发先被触发了,然后才触发onReset重置数据. 导致请求带上了上一次的参数.

📷 复现步骤

        onReset={onClear}
       
        beforeSearchSubmit={(params: Partial<API.PaginationParam>) => {
        if (searchPickerDate[0]) {
            params.date_start = searchPickerDate[0].startOf('day').valueOf();
          }
          if (searchPickerDate[1]) {
            params.date_end = searchPickerDate[1].endOf('day').valueOf();
          }
          if (state != 0) {
            params.search_status = state;
          }
          return params;
        }}

searchPickerDate和state两个数据清空后,第一次提交还是会带上清空前的数据.第二次点在正常

© 版本信息

  • ProComponents 版本: [2.7.15]
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

1 participant