Kinark / Materialize-stepper

A little plugin that implements a stepper to Materializecss framework.
https://kinark.github.io/Materialize-stepper/
MIT License
227 stars 60 forks source link

Validation function callback #50

Closed roiLeo closed 6 years ago

roiLeo commented 6 years ago

Hi, Thanks for the update. I've find something wrong with the validation function. When it return true it should proceed and when I'm returning false it should show error but it does the opposite. Here is my codepen: https://codepen.io/roileo/pen/KradYB?editors=1010 One other thing, is there any way to display which field got the required attribute ? (browser tooltip)

Kinark commented 6 years ago

Indeed, it should proceed if the validation functions returns true. In the line 244 in one of the recent commits I forgot to add a ! to invert the check.

Gonna fix it as soon as possible. I need to make some tests to avoid mistakes like this.

And yeah, it's possible to show the browser tooltip in the required inputs with functions like reportValidity, but it's a feature that I didn't implement yet.

But I believe it's possible to use the validation function with the mentioned method and achieve what you want even in the current state (without the feature).

Kinark commented 6 years ago

Fixed on the last release.