2
0
forked from jmug/cactoide

hotfix: prevent to use arrows in datepicker

This commit is contained in:
Levente Orban
2025-11-03 08:00:28 +01:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -139,6 +139,11 @@
bind:value={eventData.date}
min={today}
class="border-dark-300 w-full rounded-sm border-2 bg-white px-4 py-3 text-slate-900 shadow-sm transition-all duration-200"
on:keydown={(e) => {
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(e.key)) {
e.preventDefault();
}
}}
required
/>
{#if errors.date}

View File

@@ -162,6 +162,11 @@
bind:value={eventData.date}
min={today}
class="border-dark-300 w-full rounded-sm border-2 bg-white px-4 py-3 text-slate-900 shadow-sm transition-all duration-200"
on:keydown={(e) => {
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(e.key)) {
e.preventDefault();
}
}}
required
/>
{#if errors.date}