raisiqueira/headless-stepper-monorepo

Should onClick be possible when the current step is disabled?

kevenleone opened this issue ยท 3 comments

Hello ๐Ÿ‘‹๐Ÿป

Good job with this library, it's very helpful and well organized @raisiqueira.

I was looking into examples and I had this doubt, should the user be able to click on the step, even though the step is disabled?

See:

Gravacao.de.Tela.2023-06-09.as.17.20.11.mov

Does it make sense? From my POV, it makes sense to trigger nextStep even if it's disabled, because the dev can control whether the step is changed, different from the user clicking on the step.

image

If it's makes sense, I can send the code and the test for it

Hi @kevenleone, thanks for the detailed issue. Yes, you're right, I had handled this behavior in the Stepper component, but not in the hook. Could you open a pull request with this fix? Thanks.

Solved on #31