mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-04 12:08:12 +00:00
fix(stock): keydown number bug
This commit is contained in:
@@ -46,8 +46,9 @@ onMounted(() => {
|
|||||||
window.addEventListener('keydown', (e) => {
|
window.addEventListener('keydown', (e) => {
|
||||||
if (e.target instanceof HTMLInputElement) return;
|
if (e.target instanceof HTMLInputElement) return;
|
||||||
|
|
||||||
if (/[1234]/.test(e.key)) {
|
if (/^[1234]$/.test(e.key)) {
|
||||||
const keyNum = Number(e.key);
|
const keyNum = Number(e.key);
|
||||||
|
|
||||||
store.stockSectionMode = sectionModes[keyNum - 1];
|
store.stockSectionMode = sectionModes[keyNum - 1];
|
||||||
(sectionButtonRefs.value[keyNum - 1] as HTMLButtonElement)?.focus();
|
(sectionButtonRefs.value[keyNum - 1] as HTMLButtonElement)?.focus();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user