Skip to content

Commit 78da29a

Browse files
Merge pull request #173 from CodeForPhilly/bugfix/zbl-builderrors
fix: Refactor handlePaletteDragStart to use method.call for improved …
2 parents 51f1541 + 150f959 commit 78da29a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/GardenPlanner.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ const handlePaletteDragStart = (event: PointerEvent, plantId: string) => {
113113
// Forward the drag start to the canvas component
114114
if (canvasRef.value && 'startPaletteDrag' in canvasRef.value) {
115115
// Use bracket notation to avoid TypeScript type assertion that ESLint can't parse
116-
(canvasRef.value as any).startPaletteDrag(event, plantId);
116+
const canvas = canvasRef.value;
117+
const method = canvas['startPaletteDrag'];
118+
if (typeof method === 'function') {
119+
method.call(canvas, event, plantId);
120+
}
117121
}
118122
};
119123
</script>

0 commit comments

Comments
 (0)