What OS?
Description
The extension currently handles Ctrl + mouse wheel, but not Shift + mouse wheel, which appears to rely on the browser's default behavior:
|
function handleWheel(e: WheelEvent) { |
|
|
|
if (!e.ctrlKey) return |
|
e.preventDefault() |
|
e.stopPropagation() |
|
|
|
if (e.deltaY > 0) { |
|
decTableContentZoom() |
|
} else { |
|
incTableContentZoom() |
|
} |
|
} |
As a result, in some environments, Shift + mouse wheel scrolls vertically instead of horizontally in the CSV editor.
This appears to be related to previous reports: #23, #186.
Expected behavior
Holding Shift while using the mouse wheel should scroll the table horizontally.
Steps to reproduce
- Open a wide CSV file with Edit CSV.
- Hover over the table.
- Hold
Shift and use the mouse wheel.
- The table scrolls vertically instead of horizontally.
Suggested fix
For WSL, navigate to ~/.vscode-server/extensions/janisdd.vscode-edit-csv-0.11.9/csvEditorHtml/out/main.js, modify function handleWheel and document.documentElement.addEventListener to:
function handleWheel(e) {
if (e.ctrlKey) {
e.preventDefault();
e.stopImmediatePropagation();
if (e.deltaY > 0) {
decTableContentZoom();
} else {
incTableContentZoom();
}
return;
}
if (!e.shiftKey) {
return;
}
const holder = document.querySelector(".ht_master .wtHolder");
if (!(holder instanceof HTMLElement)) {
return;
}
e.preventDefault();
e.stopImmediatePropagation();
holder.scrollLeft += e.deltaY;
}
document.documentElement.addEventListener("wheel", handleWheel, {
passive: false,
capture: true, // Using the capture phase together with `stopImmediatePropagation()` prevents the table's default vertical wheel handling from running.
});
What OS?
Description
The extension currently handles
Ctrl + mouse wheel, but notShift + mouse wheel, which appears to rely on the browser's default behavior:vscode-edit-csv/csvEditorHtml/main.ts
Lines 523 to 534 in 6d60c00
As a result, in some environments,
Shift + mouse wheelscrolls vertically instead of horizontally in the CSV editor.This appears to be related to previous reports: #23, #186.
Expected behavior
Holding
Shiftwhile using the mouse wheel should scroll the table horizontally.Steps to reproduce
Shiftand use the mouse wheel.Suggested fix
For WSL, navigate to
~/.vscode-server/extensions/janisdd.vscode-edit-csv-0.11.9/csvEditorHtml/out/main.js, modify functionhandleWheelanddocument.documentElement.addEventListenerto: