-
Notifications
You must be signed in to change notification settings - Fork 361
fix(table): 'serial-number' column calculate error #3450
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
Conversation
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug in the table component where the serial-number column was calculated incorrectly due to unsynchronized inner pagination data in controlled usage.
- Extracts current and pageSize from the pagination property.
- Adds a call to setInnerPagination to update internal state after pagination changes.
Comments suppressed due to low confidence (1)
packages/components/table/hooks/usePagination.tsx:45
- [nitpick] Consider adding unit tests to verify that innerPagination is correctly synchronized in controlled scenarios, particularly ensuring that pageSize changes are properly reflected.
setInnerPagination({ current, pageSize });
| const { current, pageSize } = pagination; | ||
| updateDataSourceAndPaginate(current, pageSize); | ||
| setInnerPagination({ current, pageSize }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建議添加判斷isEqual判斷,不相等才執行後面的事件
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useEffect的依赖改成这样可好[pagination?.current, pagination?.pageSize, updateDataSourceAndPaginate]
* fix(configprovider): fix ConfigProvider merge bug * test(configprovider): update test snap * chore: update snapshot --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* fix(Tabs): fix Tabs lazy not working * test: add test example * perf(tabs): optimize render TabPanel * perf(tabs): clean code * fix(tabs): fix type * fix(tabpanel): fix TabPanel style --------- Co-authored-by: Heising <heising@travelconnect.cn> Co-authored-by: Uyarn <uyarnchen@gmail.com>
* fix(select): 解决select单选框在readonly模式下有光标和clear图标的问题 解决select单选框在readonly模式下有光标和clear图标的问题 #3414 * fix(select): 解决select单选框在readonly模式下有光标和clear图标的问题 解决select单选框在readonly模式下有光标和clear图标的问题 fix #3414 * fix(input): 修正了Input在readonly下如果设置了clearable,有光标和clear图标的问题 Input组件增加一个参数:allowInput,可选,默认值为 true,表示输入框是否可输入;修正了Input在readonly下如果设置了clearable,有光标和clear图标的问题 fix #3414 * fix(input): 使用useMemo/useCallback包括了常量和函数,提升基础组件Input的性能 使用useMemo/useCallback包括了常量和函数,提升基础组件Input的性能 fix #3414 * 还原Input文件,减少改动,减少review代码的工作量 * 因为参差修改涉及到了Input组件,需要重新跑test:snap-update更新快照 --------- Co-authored-by: Uyarn <uyarnchen@gmail.com>
* chore: update table demo * chore: update snapshot
* feat(Descriptions): support tableLayout api * chore: update snapshot * chore: update snapshot * chore: default value --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Uyarn <uyarnchen@gmail.com>
… and creatable (#3430) * feat(select): options属性数据支持SelectOptionGroup类型 * fix(select): 修复children中ReactElement和map函数混写导致的数据异常 * feat(select): 分组选择器多选模式下支持全选功能 * feat(select): 分组选项器支持过滤 * fix(select): 修复options选择不到的问题 * fix(select): 调整Group的dom结构,移除多余的属性 * chore: update snapshot * chore: update snapshot * chore: remove commented-out code in Select components --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: wū yāng <uyarnchen@gmail.com>
* fix: fix esm bundle * chore: fix bundle result * chore: fix * fix: fix ts production * chore: fix eslint
…3432) * docs: add demonstration for overriding floating layer style * chore: use default values for display
* fix: 🐛 getPareents error when tree data update ✅ Closes: 3461 * chore: revert change --------- Co-authored-by: wū yāng <uyarnchen@gmail.com>
* Release: 1.11.2 * chore: update common * fix(input): fix Input readonly mode can show clear icon * chore: revert change * chore: changelog's changes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Uyarn <uyarnchen@gmail.com>
* fix(Textarea): fix TextArea autofocus and autosize bug * test: update test case * fix(portal): fix Portal render child component * test(textarea): update test case --------- Co-authored-by: Heising <heising@travelconnect.cn>
* docs(config-provider): sync api * chore: remove jumper --------- Co-authored-by: wū yāng <uyarnchen@gmail.com>
…gn-react into fix/use-pagination

🤔 这个 PR 的性质是?
🔗 相关 Issue
受控用法下,pagination修改后innerPagination数据未同步,导致序号列计算错误

💡 需求背景和解决方案
📝 更新日志
fix(组件名称): 处理问题或特性描述 ...
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单