@@ -29,7 +29,11 @@ import { useVscodeWebview } from "../../common/vscodeWebviewProvider";
29
29
import ResultGrid , { ResultGridHandle } from "./resultGrid" ;
30
30
import CommandBar from "./commandBar" ;
31
31
import { locConstants } from "../../common/locConstants" ;
32
- import { ACTIONBAR_WIDTH_PX , TABLE_ALIGN_PX } from "./table/table" ;
32
+ import {
33
+ ACTIONBAR_WIDTH_PX ,
34
+ SCROLLBAR_PX ,
35
+ TABLE_ALIGN_PX ,
36
+ } from "./table/table" ;
33
37
import { ExecutionPlanPage } from "../ExecutionPlan/executionPlanPage" ;
34
38
import { ExecutionPlanStateProvider } from "../ExecutionPlan/executionPlanStateProvider" ;
35
39
import { hasResultsOrMessages } from "./queryResultUtils" ;
@@ -156,6 +160,11 @@ export const QueryResultPane = () => {
156
160
157
161
if ( gridParent . clientWidth && availableHeight ) {
158
162
if ( gridCount > 1 ) {
163
+ let scrollbarAdjustment =
164
+ gridCount * MIN_GRID_HEIGHT >= availableHeight
165
+ ? SCROLLBAR_PX
166
+ : 0 ;
167
+
159
168
// Calculate the grid height, ensuring it's not smaller than the minimum height
160
169
const gridHeight = Math . max (
161
170
( availableHeight - gridCount * TABLE_ALIGN_PX ) /
@@ -165,19 +174,16 @@ export const QueryResultPane = () => {
165
174
166
175
gridRefs . current . forEach ( ( gridRef ) => {
167
176
gridRef ?. resizeGrid (
168
- gridParent . clientWidth - ACTIONBAR_WIDTH_PX ,
177
+ gridParent . clientWidth -
178
+ ACTIONBAR_WIDTH_PX -
179
+ scrollbarAdjustment ,
169
180
gridHeight ,
170
181
) ;
171
182
} ) ;
172
183
} else if ( gridCount === 1 ) {
173
- const singleGridHeight = Math . max (
174
- availableHeight - TABLE_ALIGN_PX ,
175
- MIN_GRID_HEIGHT ,
176
- ) ;
177
-
178
184
gridRefs . current [ 0 ] ?. resizeGrid (
179
185
gridParent . clientWidth - ACTIONBAR_WIDTH_PX ,
180
- singleGridHeight ,
186
+ availableHeight - TABLE_ALIGN_PX ,
181
187
) ;
182
188
}
183
189
}
0 commit comments