#NumberInput

1 messages · Page 1 of 1 (latest)

floral sigil
#

I currently have the issue where the number gets change once the focus is lost after I updated the package.

this worked fine until now

the code

const [inputUserId, setInputUserId] = useState("");




<NumberInput
styles={{
input: {
backgroundColor: "#0D1117",
},
}}
p={"sm"}
label="Discord ID"
placeholder="Discord ID"
value={inputUserId}
   onChange={(value) => {
   console.log(value);
   console.log(typeof value);
   setInputUserId(value.toString())
}}
error={!validInputUserId && inputUserId.length > 0}
allowDecimal={false}
allowNegative={false}
clampBehavior="none"

hideControls
leftSection={<FontAwesomeIcon icon={faDiscord} color="var(--mantine-color-starlight-2)" />}
/>


I've added a video showing the problem.
is this an error on my side?

finite sinew
floral sigil
#

yea, but it worked until now

and here it says that if the num is to big it should be a string

#

#1211982944684609566 message

#

and the input is a Number only input so with TextInput is the wrong one

floral sigil
finite sinew
#

Wasn't aware of that, thats a good point.

What does the console.log say of value before you set the state? Is it already the incorrect one or?

floral sigil
#

it gets logt onChange

#

and when i unfocus the value changes type to num instead of string

floral sigil
#

@finite sinew Sorry for the ping, but has anything been found, or is it a problem on my end?

finite sinew
floral sigil
finite sinew
#

Then I would suggest opening a bug report with 2 sandboxes, 1 of the old version, 1 of the new