From e7687eaa7ff2d57f7fe36513fcd83eb48c3a2938 Mon Sep 17 00:00:00 2001 From: NipuniBhagya Date: Wed, 11 Dec 2024 22:38:18 +0530 Subject: [PATCH] Fix issue in OTP field adapter --- .../src/components/adapters/otp-field-adapter.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/identity-apps-core/react-ui-core/src/components/adapters/otp-field-adapter.js b/identity-apps-core/react-ui-core/src/components/adapters/otp-field-adapter.js index 7b09d04e703..862c1da7d09 100644 --- a/identity-apps-core/react-ui-core/src/components/adapters/otp-field-adapter.js +++ b/identity-apps-core/react-ui-core/src/components/adapters/otp-field-adapter.js @@ -21,20 +21,16 @@ import PropTypes from "prop-types"; import React, { useEffect, useState } from "react"; import { useTranslations } from "../../hooks/use-translations"; import { getTranslationByKey } from "../../utils/i18n-utils"; -import ValidationCriteria from "../field-validation"; -const OTPFieldAdapter = ({ component, formState, formStateHandler, otpLength = 6 }) => { +const OTPFieldAdapter = ({ component, formStateHandler, otpLength = 6 }) => { - const { label, required, styles, validation } = component.properties; - const { errors } = formState; - const fieldErrors = errors && errors.filter(error => error.field === component.properties.name); + const { label, required, styles } = component.properties; const { translations } = useTranslations(); const [ otpValues, setOtpValues ] = useState(Array(otpLength).fill("")); useEffect(() => { - // Join all OTP fields to form the complete OTP value formStateHandler(component.properties.name, otpValues.join("")); }, [ otpValues ]); @@ -125,9 +121,6 @@ const OTPFieldAdapter = ({ component, formState, formStateHandler, otpLength = 6 /> ) } - { validation && ( - - ) } ); };