Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formik Validation #3964

Open
AbdulrahmanM0 opened this issue Apr 5, 2024 · 1 comment
Open

Formik Validation #3964

AbdulrahmanM0 opened this issue Apr 5, 2024 · 1 comment

Comments

@AbdulrahmanM0
Copy link

setFieldError not working

   function handleError(){
    
    if(reverse_auto.length === Object.keys(props.values.columns).length){
        if(sum(Object.values(props.values.columns)) > props.values.total_width){
             props.setFieldError('exceed', "* total width of columns must not exceed Total width");
        }
        if(sum(Object.values(props.values.columns)) < props.values.total_width){
            props.setFieldError('less', "* total width of columns must not be less than Total width");
        }
    }
  }

Bug report

Current Behavior

Expected behavior

Reproducible example

Suggested solution(s)

Additional context

Your environment

Software Version(s)
Formik
React
TypeScript
Browser
npm/Yarn
Operating System
@erashu212
Copy link

Please share codesandbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants