Skip to content

Commit 31cfc2d

Browse files
committed
Eslint
1 parent 2150da7 commit 31cfc2d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

frontend/src/components/widgets/inputs/RulerInput.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,13 @@
108108
if (e.button !== 0) return; // Only handle left-click
109109
110110
isDragging = true;
111-
const element = e.currentTarget as HTMLElement;
111+
if (!(e.currentTarget instanceof HTMLElement)) return;
112+
const element = e.currentTarget;
112113
element.setPointerCapture(e.pointerId);
113114
114115
// Get the viewport element to compute positions relative to it
115-
const viewportEl = window.document.querySelector("[data-viewport]") as HTMLElement;
116-
if (!viewportEl) {
116+
const viewportEl = window.document.querySelector("[data-viewport]");
117+
if (!(viewportEl instanceof HTMLElement)) {
117118
isDragging = false;
118119
return;
119120
}
@@ -130,7 +131,8 @@
130131
if (!isDragging) return;
131132
isDragging = false;
132133
133-
const element = e.currentTarget as HTMLElement;
134+
if (!(e.currentTarget instanceof HTMLElement)) return;
135+
const element = e.currentTarget;
134136
element.releasePointerCapture(e.pointerId);
135137
}
136138

0 commit comments

Comments
 (0)