The codes above find errorClassElement based on the values from self.config.classTo and self.config.errorTextParent. If they have the same values, then errorClassElement will take the element from classTo. If not, then errorClassElement will take the element from errorTextParent.
Based on this issue https://github.com/sha256/Pristine/issues/42, I propose this fix.
I've added some if statements to look for if
self.config.classTo
is the same asself.config.errorTextParent
.The main focus is on these lines:
The codes above find
errorClassElement
based on the values fromself.config.classTo
andself.config.errorTextParent
. If they have the same values, thenerrorClassElement
will take the element fromclassTo
. If not, thenerrorClassElement
will take the element fromerrorTextParent
.Some of these changes are credited from https://github.com/sha256/Pristine/pull/43 that add or remove valid and invalid classes from input field.
Here, I've created a Bootstrap Form to test out my changes. https://ryumada.github.io/Pristine-test-bootstrap/