Skip to content

Commit d9a3461

Browse files
Scott DoverScott Dover
authored andcommitted
chore: fix dnd/menu alignment issue
Signed-off-by: Scott Dover <[email protected]>
1 parent a4ca8d2 commit d9a3461

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

client/src/webview/DataViewer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ const DataViewer = () => {
7474
defaultColDef={{
7575
sortable: true,
7676
}}
77+
maintainColumnOrder
7778
infiniteInitialRowCount={100}
7879
maxBlocksInCache={10}
7980
onGridReady={onGridReady}

client/src/webview/useDataViewer.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ const useDataViewer = (theme: string) => {
146146
});
147147
},
148148
};
149-
150149
event.api.setGridOption("datasource", dataSource);
151150
},
152151
[columns],
@@ -203,14 +202,17 @@ const useDataViewer = (theme: string) => {
203202
params.event.key === "Enter" ||
204203
(params.event.key === "F10" && params.event.shiftKey)
205204
) {
206-
const dropdownButton =
207-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
208-
(params.event.target as HTMLElement).querySelector(
209-
".dropdown > button",
210-
);
211-
if (!dropdownButton) {
205+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
206+
const dropdown = (params.event.target as HTMLElement).querySelector(
207+
".dropdown",
208+
);
209+
if (!dropdown) {
212210
return true;
213211
}
212+
if (!dropdown.classList.contains("active")) {
213+
dropdown.classList.add("active");
214+
}
215+
const dropdownButton = dropdown.querySelector("button");
214216
displayMenuForColumn(
215217
params.api,
216218
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions

0 commit comments

Comments
 (0)