Skip to content

Commit

Permalink
fix: clicking seperator on heatmap no longer crashes the app (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellvix authored Dec 2, 2024
1 parent dc59817 commit 7197d98
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/js/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7197d98

Please sign in to comment.