mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: numbers edits.
This commit is contained in:
@@ -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;
|
||||
|
||||
+6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user