Topic: MDBValidationItem is removed and MDBInput validation has issues in MDB5

clickstudioltd priority asked 2 years ago


Expected behavior

Proper server-side validation.

Actual behavior

According to MDB5 React docs, for server-side validation there should be an MDBValidationItem component to do this, but this component is not in the list of MDB5's exported components which implies that the docs for MDB5 are outdated. I can see that MDBInput has invalid and validation parameters for this purpose, but setting invalid to true or false always makes the input to render as valid as you can see in the picture below where the description should be invalid. And, there is no invalidation parameter to set the invalid state text for the field rather there is only a validation parameter which is used to set the valid state text. Also, the validation string tag that gets inserted under the input field is not accounted as part of the input wrapper tag, therefore it goes under the 'Update Profile' button but I don't have it in this particular picture.

Resources (screenshots, code snippets etc.)

enter image description here


Wojciech Staniszewski staff commented 2 years ago

Are you sure you updated the MDBReact version to 3.0.0? We have introduced a new MDBValidation in this package and it looks like you are using the older version.


clickstudioltd priority commented 2 years ago

I have installed the mdb5-react-ui-kit-pro-advanced package and as far as I know it's shipped with React v3.0.0. I haven't updated that package since two weeks ago, I don't know if there has been a change since then. Regardless, the docs for MDB5 + React are still using the MDBValidationItem in their examples.


Wojciech Staniszewski staff commented 2 years ago

MDBValidationItem was introduced in 3.0.0 version. Properties like valid or invalid have been removed. The docs are up to date and the way you are trying to use MDBValidation is deprecated. Please try to update MDBReact to the newest version (it was released on 21.03). Then you will be able to use MDBValidationItem like it is in the docs.


clickstudioltd priority commented 2 years ago

Thank you for informing me! Like I said the package must have gotten an update since I've installed it two weeks ago which led me to make this mistake.


Wojciech Staniszewski staff commented 2 years ago

No problem! if you have more questions do not hesitate :)



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB React
  • MDB Version: MDB5 3.0.0
  • Device: PC
  • Browser: Mozilla Firefox
  • OS: Windows 10
  • Provided sample code: Yes
  • Provided link: No