fixing magic code input error (#2514)

Co-authored-by: pory-gone <pory-gone@kali>
This commit is contained in:
pory 2025-09-22 19:43:41 +02:00 committed by GitHub
parent 4df6cfad91
commit 3df155f4f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1451,6 +1451,7 @@ export function MultiInput ({
onChange, autoFocus, hideError, inputType = 'text',
...props
}) {
const formik = useFormikContext()
const [inputs, setInputs] = useState(new Array(length).fill(''))
const inputRefs = useRef(new Array(length).fill(null))
const [, meta, helpers] = useField({ name })
@ -1549,7 +1550,7 @@ export function MultiInput ({
))}
</div>
<div>
{hideError && meta.touched && meta.error && ( // custom error message is showed if hideError is true
{hideError && formik.submitCount > 0 && meta.touched && meta.error && ( // custom error message is showed if hideError is true
<BootstrapForm.Control.Feedback type='invalid' className='d-block'>
{meta.error}
</BootstrapForm.Control.Feedback>