skeleton icon indicating copy to clipboard operation
skeleton copied to clipboard

stepTerm in <Step> not working as expected

Open alexschnabl opened this issue 3 years ago • 3 comments

Current Behavior

The step term property in doesn't work. I tried this:

<Stepper stepTerm='TestStep'>
    <Step stepTerm='OtherTestStep'>
        <svelte:fragment slot="header">(header)</svelte:fragment>
        (content)
    </Step>
    <Step stepTerm='AnotherTestStep'>
        <svelte:fragment slot="header">(header)</svelte:fragment>
        (content)
    </Step>
</Stepper>

as specified in the documentation but the Step just shows "TestStep" and not "OtherTestStep" or "AnotherTestStep". Is this an issue or am I doing something wrong

Expected Behavior

I expect to be able to overwrite the stepTerm for each step seperately.

Steps To Reproduce

No response

Link to Reproduction / Stackblitz

No response

More Information

No response

alexschnabl avatar Sep 01 '23 20:09 alexschnabl

@SK4P3 yeah looks like a misunderstanding of how the prop is used in the child items. The source might help:

  • https://github.com/skeletonlabs/skeleton/blob/master/packages/skeleton/src/lib/components/Stepper/Step.svelte#L118
  • https://github.com/skeletonlabs/skeleton/blob/master/packages/skeleton/src/lib/components/Stepper/Step.svelte#L122

So essentially the only place stemTerm is used within the item is in the header/content slot default values. Since you're setting your own header/content slot content, this will not be visible.

You may be expecting stepTerm to carry up to the parent Stepper, which is not (and likely never will be) the case.

endigo9740 avatar Sep 01 '23 22:09 endigo9740

That said, we do have plans to revisit the Stepper component in the future. If you have a use case for this, then suggestions are welcome here:

  • https://github.com/skeletonlabs/skeleton/issues/1780

endigo9740 avatar Sep 01 '23 22:09 endigo9740

Thanks for the answer!

alexschnabl avatar Sep 01 '23 22:09 alexschnabl