element-plus [Feature Request] Scroll the selected row into view when calling el-table's setCurrentRow method.

ifsvaxew  于 2023-03-19  发布在  其他
关注(0)|答案(1)|浏览(248)

Existing Component

Yes

Component Name

el-table

Description

As the title, if I have many items in the table, the selected item maybe not in the first page. Could we scroll the selected row into view when call el-table's setCurrentRow method (or as a optional behavior that can be specified by arguments passing to setCurrentRow )?

I know there exists some walkaround, maybe through DOM, but these walkarounds depend on the inner design of the el-table component, which may fail in newer versions of elements. e.g., the walkaround I used failed after beta.6 because the el-table's scrollbar was refactored using el-scrollbar. By the way, using raw DOM to implement such a feature seems to be too complicated.

相关问题