fix(stock): keydown number bug

This commit is contained in:
2024-04-14 21:45:51 +02:00
parent 1aca0f7ed1
commit b840a6cd46
+2 -1
View File
@@ -46,8 +46,9 @@ onMounted(() => {
window.addEventListener('keydown', (e) => {
if (e.target instanceof HTMLInputElement) return;
if (/[1234]/.test(e.key)) {
if (/^[1234]$/.test(e.key)) {
const keyNum = Number(e.key);
store.stockSectionMode = sectionModes[keyNum - 1];
(sectionButtonRefs.value[keyNum - 1] as HTMLButtonElement)?.focus();
}