feat: Arrow keys to move back in the current line
This commit is contained in:
@@ -669,6 +669,7 @@
|
||||
}
|
||||
selected = null;
|
||||
highlights = [];
|
||||
playSound('undo');
|
||||
}
|
||||
|
||||
function resetBoard(showSelection = true) {
|
||||
@@ -1354,8 +1355,21 @@
|
||||
}
|
||||
moveTags[currentRep] = { ...moveTags[currentRep] };
|
||||
}
|
||||
|
||||
function handleKeyDown(e) {
|
||||
if (e.key === 'ArrowLeft') {
|
||||
const target = e.target;
|
||||
if (target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable)) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
goBack();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:window onkeydown={handleKeyDown} />
|
||||
|
||||
<svelte:head>
|
||||
<title>Chess Opening Repertoire Builder</title>
|
||||
</svelte:head>
|
||||
|
||||
Reference in New Issue
Block a user