ant-design / ant-design/pro-components

🐛[BUG]ProTable横向滚动的时候,onScroll事件不触发

Open
#9,082 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

### 🐛 bug 描述

ProTable横向滚动的时候,onScroll事件不触发。
我们有个场景的表格非常宽(40列),并且非常高(100行),要求同时展示
现在的情况是横向滚动条在页面最底部,想要看表格后面的列,需要滚动到页面最底部,然后拖动横向滚动条,才能看到后面的列,非常的麻烦。
我想要模拟一个滚动条放到表格的顶部,可以通过通过这个模拟的滚动条,可以横向滚动表格。
所以用到了onScroll事件。

### 📷 复现步骤

` {
console.log(event);
}}/>`

### 🏞 期望结果

希望onScroll事件可以触发。返回滚动的距离方向等数据。

### 💻 复现代码
` {
console.log(event);
}}/>`

### © 版本信息

- ProComponents 版本: 2.8.7
- umi 版本:4.4.6
- 浏览器环境:chrome 135.0.7049.96(正式版本) (64 位)
- 开发环境:windows 11 x64

Contributor guide

Open the contributing guide

Research direction

Start from the ProTable usage shown in the report and reproduce horizontal scrolling with scroll={{ x: 'max-content' }} in Chrome. Trace the onScroll entry point and verify that the callback reports horizontal scroll distance and direction; done means the callback fires while the table is scrolled horizontally.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.