You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect for the onComplete handler to only be called
When the input changes, if the value is complete
[Optionally] When the component initially loads, if the value is complete
Note that changing state seems necessary to reproduce this, and the following does not call onComplete repeatedly.
function Demo() {
function handleComplete() {
console.log('complete');
}
return (
<MantineProvider>
<PinInput onComplete={handleComplete} />
</MantineProvider>
);
}
For context, in my use case, when the input is complete, I want to proceed with my authentication flow, and as a part of that I set some loading state to true (to trigger some visual feedback). My onComplete handler runs many times, causing issues with the auth flow.
I am currently working around this using a solution like the following, but ideally the onComplete behavior would match:
Dependencies check up
What version of @mantine/* packages do you have in package.json?
7.5.2
What package has an issue?
@mantine/core
What framework do you use?
Remix
In which browsers you can reproduce the issue?
Safari
Describe the bug
The
onComplete
handler forPinInput
is called repeatedly when the handler changes some state.For example, the following calls
onComplete
repeatedly, causing the counter to increase uncontrollably.I would expect for the
onComplete
handler to only be calledNote that changing state seems necessary to reproduce this, and the following does not call
onComplete
repeatedly.For context, in my use case, when the input is complete, I want to proceed with my authentication flow, and as a part of that I set some loading state to true (to trigger some visual feedback). My
onComplete
handler runs many times, causing issues with the auth flow.I am currently working around this using a solution like the following, but ideally the
onComplete
behavior would match:If possible, include a link to a codesandbox with a minimal reproduction
No response
Possible fix
No response
Self-service
The text was updated successfully, but these errors were encountered: