biswajitsundara / ghewar

A react component library
https://www.npmjs.com/package/ghewar
MIT License
1 stars 0 forks source link

Input component min length, max length are not working correctly #9

Closed biswajitsundara closed 1 day ago

biswajitsundara commented 2 days ago

If we set min character 3 then if we type 3 characters then it should remove the error image

similarly max character, it should throw error when its exceeded specified 10 characters, now it's throwing error more than 10 characters

biswajitsundara commented 2 days ago

the code needs to be updated if (validator.minLength && value.length <= validator.minLength) { isValid = false; errorMessage = Minimum ${validator.minLength} characters required; }

  if (validator.maxLength && value.length >= validator.maxLength) {
    isValid = false;
    errorMessage = `Maximum ${validator.maxLength} characters allowed`;
  }
biswajitsundara commented 1 day ago

The issue is fixed and will be available in next release.