olton / Metro-UI-CSS

Impressive component library for expressive web development! Build responsive projects on the web with the first front-end component library in Metro Style. And now there are even more opportunities every day!
http://metroui.org.ua/
MIT License
7k stars 1.97k forks source link

Stepper "data-on-step-click" not going to callback function #1873

Open Vamoshi opened 2 years ago

Vamoshi commented 2 years ago

Discussed in https://github.com/olton/Metro-UI-CSS/discussions/1872

Originally posted by **Vamoshi** June 13, 2022 Hello so I was introduced by my friend to Metro 4 and so far I am loving it. However, one very frustrating thing I've come across is that the "data-on-step-click" does not work in the stepper. Here is my code snippet: ```


The onStepClick callback does not fire in this case, however I tried placing the function as the callback for "data-on-step", and the function is working fine there. I've been trying out different things the past few hours and I can't seem to make it work.

There's only this one line in the documentation talking about "data-on-step-click":

_onStepClick(step, element) | data-on-step-click | Fired when user click on the step (required set attribute data-click-step="true")_

There's nothing else in the documentation I could find that was able to help me, not even an example for this data attribute, it just mentions it. Any assistance is greatly appreciated! Thanks!

This is the website where I'm reading the documentation from btw:
https://metroui.org.ua/stepper.html</div>
Elfsong commented 1 year ago
<div data-role="stepper"
     data-steps="6"
     data-view="cycle"
     data-clickable="true"
     data-on-step-click="onStepClick"
     data-click-step="true"
     data-on-step="onStep">
</div>

Try it. Swap the order of data-on-step-click and data-click-step.