From 7197d9896162a268765417d42583fe2d6fcd8132 Mon Sep 17 00:00:00 2001 From: ellvix Date: Sun, 1 Dec 2024 18:21:50 -0700 Subject: [PATCH] fix: clicking seperator on heatmap no longer crashes the app (#610) --- src/js/controls.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/controls.js b/src/js/controls.js index 3f5064ed..9d2c88bc 100644 --- a/src/js/controls.js +++ b/src/js/controls.js @@ -472,15 +472,19 @@ class Control { // we lock the selection while we're changing stuff so it doesn't loop constants.lockSelection = true; - // exception: don't let users click the seperator char + // exception: don't let users click the seperator char, so make them click just before let seperatorPositions = constants.brailleInput.value .split('') .reduce((positions, char, index) => { if (char === '⠳') positions.push(index); return positions; }, []); + console.log('seperatorPositions', seperatorPositions); + console.log('pos', pos); if (seperatorPositions.includes(pos)) { - return; + if (pos > 0) { + pos += -1; + } } // we're using braille cursor, update the selection from what was clicked