fix: numbers edits.

This commit is contained in:
Darshan
2025-08-31 12:13:20 +05:30
parent bf5ff13bbe
commit 643ebef035
4 changed files with 15 additions and 8 deletions
+3 -2
View File
@@ -18,8 +18,9 @@
let error: string;
function coerceToNumber(event: Event & { currentTarget: EventTarget & HTMLInputElement }) {
const raw = event.currentTarget?.value ?? '';
function coerceToNumber(event: CustomEvent) {
const raw = event.detail ?? '';
if (raw === '') {
value = nullable ? null : (undefined as unknown as number);
return;
@@ -1,6 +1,7 @@
<script lang="ts">
import { InputNumber } from '$lib/elements/forms';
import type { Models } from '@appwrite.io/console';
import { isWithinSafeRange } from '$lib/helpers/numbers';
export let id: string;
export let label: string;
@@ -13,6 +14,11 @@
$: if (limited) {
label = undefined;
}
$: if (limited) {
column.min = isWithinSafeRange(column.min) ? column.min : Number.MIN_SAFE_INTEGER;
column.max = isWithinSafeRange(column.max) ? column.max : Number.MAX_SAFE_INTEGER;
}
</script>
<InputNumber