Spaces:
Runtime error
Runtime error
testing focus to enable keyboard
Browse files
frontend/src/routes/index.svelte
CHANGED
|
@@ -24,7 +24,10 @@
|
|
| 24 |
restartBoard();
|
| 25 |
window.addEventListener('keyup', onKeyup, true);
|
| 26 |
window.addEventListener('resize', onResize);
|
|
|
|
|
|
|
| 27 |
});
|
|
|
|
| 28 |
function onResize() {
|
| 29 |
document.body.style.setProperty('--vh', window.innerHeight + 'px');
|
| 30 |
}
|
|
|
|
| 24 |
restartBoard();
|
| 25 |
window.addEventListener('keyup', onKeyup, true);
|
| 26 |
window.addEventListener('resize', onResize);
|
| 27 |
+
window.focus();
|
| 28 |
+
document.body.addEventListener('click', () => window.focus(), false);
|
| 29 |
});
|
| 30 |
+
|
| 31 |
function onResize() {
|
| 32 |
document.body.style.setProperty('--vh', window.innerHeight + 'px');
|
| 33 |
}
|