Skip to content

Commit 74359d9

Browse files
committed
doc: 更新 TableSection 示例滚动逻辑
1 parent fc3f88b commit 74359d9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
export function scroll(id) {
22
const element = document.getElementById(id);
33
if (element) {
4-
const selectedRow = element.querySelector('.form-check.is-checked');
4+
const selectedRow = element.querySelector('tr.active');
55
if (selectedRow) {
6-
const row = selectedRow.closest('tr');
7-
if (row) {
8-
row.scrollIntoView({ behavior: 'smooth', block: 'center' });
9-
}
6+
selectedRow.scrollIntoView({ behavior: 'smooth', block: 'center' });
107
}
118
}
129
}

0 commit comments

Comments
 (0)