Skip to content

Commit 510a3e7

Browse files
committed
add max int to number input
1 parent f04ff96 commit 510a3e7

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/lib/components/workflow/search-attribute-input/index.svelte

+10-5
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,16 @@
7676
{:else if attribute.type === SEARCH_ATTRIBUTE_TYPE.DATETIME}
7777
<DatetimeInput bind:value={attribute.value} />
7878
{:else if attribute.type === SEARCH_ATTRIBUTE_TYPE.INT || attribute.type === SEARCH_ATTRIBUTE_TYPE.DOUBLE}
79-
<NumberInput
80-
label={translate('common.value')}
81-
id="attribute-value"
82-
bind:value={attribute.value}
83-
/>
79+
<div>
80+
<NumberInput
81+
label={translate('common.value')}
82+
id="attribute-value"
83+
valid={attribute.value < Number.MAX_SAFE_INTEGER}
84+
hintText="Number is too large"
85+
bind:value={attribute.value}
86+
max={Number.MAX_SAFE_INTEGER}
87+
/>
88+
</div>
8489
{:else if attribute.type === SEARCH_ATTRIBUTE_TYPE.KEYWORDLIST}
8590
<ChipInput
8691
label={translate('common.value')}

src/lib/holocene/input/number-input.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<Label {required} {label} hidden={labelHidden} for={id} />
4040
<div class="flex items-center gap-2">
4141
<div
42-
class="surface-primary relative box-border flex h-10 w-16 items-center border border-subtle text-sm focus-within:outline-none focus-within:ring-2 focus-within:ring-primary/70"
42+
class="surface-primary relative box-border flex h-10 min-w-16 items-center border border-subtle text-sm focus-within:outline-none focus-within:ring-2 focus-within:ring-primary/70"
4343
class:opacity-50={disabled}
4444
class:search
4545
class:invalid={!valid}

0 commit comments

Comments
 (0)