Issue with Register Function when input return value only, not a SyntheticEvent. #11120
Unanswered
gaddamsairam
asked this question in
Q&A
Replies: 2 comments
-
Not sure if there is a better way to solve this but we had similar issues with date selects and you can just handle
Where
|
Beta Was this translation helpful? Give feedback.
0 replies
-
use a controller instead. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
"I'm encountering an issue when using the register function. The problem is that the register function expects a
SyntheticEvent
, but theMantine-NumberInput
component only returns the value."Reproduction Steps:
Mantine-NumberInput
component.register
function to register theNumberInput
.TypeError
in the console.TypeError
: Cannot read properties of undefined (reading 'name')With Register:
<NumberInput
{...register('phone_no', {
required: 'Contact details is required',
})}
error={errors.phone_no && errors.phone_no.message}
name='phone_no'
variant='filled'
classNames={{ input: 'text-[18px] bg-transparent border-2 border-white rounded-lg h-11 w-full text-white ', label: 'text-white pb-2', }}
label='Phone No.'
autoComplete='off'
withAsterisk
hideControls
/>
With Controller:
In
Controller
we have filed.Onchange(e)"How can we address this scenario when the
NumberInput
function does not provide aSyntheticEvent
?"Closing Statement:
Thank you for your assistance in resolving this issue. Any help or guidance is greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions