Skip to content

Commit d40009f

Browse files
committed
Fix virtualization after moving the scroller
1 parent c3ea992 commit d40009f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/datagrid.vue

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<template>
22
<div class='dg-wrapper'>
3-
<div class='dg-scroller'>
4-
<table class='dg' :class='selected && "dg-selectable"'
5-
v-virtual='virtual'>
3+
<div class='dg-scroller' v-virtual='virtual'>
4+
<table class='dg' :class='selected && "dg-selectable"'>
65
<thead>
76
<tr>
87
<th v-if='selected' class='dg-header'>

src/virtual.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type VirtualHTMLTable = HTMLTableElement & { _vscroll: VirtualState };
5151
const resizeObserver = new ResizeObserver(entries => {
5252
for (let entry of entries) {
5353
let table = entry.target as VirtualHTMLTable;
54-
table._vscroll.height = entry.contentRect.height - table.tHead!.clientHeight;
54+
table._vscroll.height = entry.contentRect.height - table.querySelector('tHead')!.clientHeight;
5555
}
5656
});
5757

0 commit comments

Comments
 (0)