[READ-ONLY] a fast, modern browser for the npm registry

fix: prevent trends date input from being disabled while typing (#1370)

Co-authored-by: Daniel Roe <daniel@roe.dev>

authored by

rygrit
Daniel Roe
and committed by
GitHub
2e7a4552 ac9e0231

+6 -2
+4 -2
app/components/Package/TrendsChart.vue
··· 16 16 WeeklyDataPoint, 17 17 YearlyDataPoint, 18 18 } from '~/types/chart' 19 + import { DATE_INPUT_MAX } from '~/utils/input' 19 20 20 21 const props = withDefaults( 21 22 defineProps<{ ··· 1452 1453 v-if="showFacetSelector" 1453 1454 id="trends-metric-select" 1454 1455 v-model="selectedMetric" 1456 + :disabled="activeMetricState.pending" 1455 1457 :items="METRICS.map(m => ({ label: m.label, value: m.id }))" 1456 1458 :label="$t('package.trends.facet')" 1457 1459 /> ··· 1485 1487 <InputBase 1486 1488 id="startDate" 1487 1489 v-model="startDate" 1488 - :disabled="activeMetricState.pending" 1489 1490 type="date" 1491 + :max="DATE_INPUT_MAX" 1490 1492 class="w-full min-w-0 bg-transparent ps-7" 1491 1493 size="medium" 1492 1494 /> ··· 1505 1507 <InputBase 1506 1508 id="endDate" 1507 1509 v-model="endDate" 1508 - :disabled="activeMetricState.pending" 1509 1510 type="date" 1511 + :max="DATE_INPUT_MAX" 1510 1512 class="w-full min-w-0 bg-transparent ps-7" 1511 1513 size="medium" 1512 1514 />
+2
app/utils/input.ts
··· 26 26 !event.shiftKey 27 27 ) 28 28 } 29 + 30 + export const DATE_INPUT_MAX = '9999-12-31'