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(useAntdTable): reset pageSize (#2085) #2090

Merged
merged 1 commit into from Mar 6, 2023

Conversation

Ali-ovo
Copy link
Contributor

@Ali-ovo Ali-ovo commented Mar 3, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

fix: #2085

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English fix not reset pageSize
🇨🇳 Chinese 修复 reset 的时候没有重置当前 table 的 pageSize

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@Ali-ovo
Copy link
Contributor Author

Ali-ovo commented Mar 3, 2023

修复了这个 issues

@Ali-ovo Ali-ovo force-pushed the Ali/fix-useAntdTable branch 3 times, most recently from 4cd2fe2 to f96c371 Compare March 3, 2023 04:54
@Ali-ovo
Copy link
Contributor Author

Ali-ovo commented Mar 5, 2023

ready for review @crazylxr

@miracles1919
Copy link
Collaborator

@Ali-ovo 补个测试用例

@crazylxr crazylxr merged commit 2d2cd69 into alibaba:master Mar 6, 2023
@Ali-ovo Ali-ovo deleted the Ali/fix-useAntdTable branch March 6, 2023 11:56
@xiaomoziyi
Copy link

这个版本修复修出bug了。
image

如果reset要充值页码,应该用reset defaultPageSize, 而不是defaultParams,defaultParams是作为初次传参使用的。不然的话,refreshDeps的说明是refreshDeps 变化,会重置 current 到第一页,并重新发起请求。现在这个版本,会把current重置到defaultParams的current.
希望尽快修复!!!! @crazylxr @Ali-ovo

@Ali-ovo
Copy link
Contributor Author

Ali-ovo commented Apr 24, 2023

这个版本修复修出bug了。 image

如果reset要充值页码,应该用reset defaultPageSize, 而不是defaultParams,defaultParams是作为初次传参使用的。不然的话,refreshDeps的说明是refreshDeps 变化,会重置 current 到第一页,并重新发起请求。现在这个版本,会把current重置到defaultParams的current. 希望尽快修复!!!! @crazylxr @Ali-ovo

_submit(
defaultParams?.[0] || {
pageSize: options.defaultPageSize || 10,
current: 1,
},
);

貌似 defaultParams defaultPageSize 会有一个同时存在的情况 所有导致 reset 有些歧义
目前 reset 的逻辑是优先判断的 defaultParams

@xiaomoziyi
Copy link

xiaomoziyi commented Apr 24, 2023 via email

@Ali-ovo
Copy link
Contributor Author

Ali-ovo commented Apr 24, 2023

收到。

个人感觉 defaultParams 中 pageSize 的权重会比 defaultPageSize 的权重高, 如有 defaultParams 你应当这么使用

defaultParans:{
    pageSize: xxx
}

而不是重复定义 defaultParamsdefaultPageSize

@xiaomoziyi
Copy link

xiaomoziyi commented Apr 24, 2023 via email

@hchlq
Copy link
Collaborator

hchlq commented Apr 25, 2023

@Ali-ovo 帮忙看下,不行先回滚回去哈

hchlq added a commit to hchlq/hooks that referenced this pull request Apr 27, 2023
crazylxr pushed a commit that referenced this pull request Apr 30, 2023
* Revert "fix(useAntdTable): reset pageSize (#2090)"

This reverts commit 2d2cd69.

* fix: use defaultParams pageSize when defaultPageSize is not passed

* fix: does not affect submit
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.

useAntdTable resetAPI未重置条数
5 participants