You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by Akkretion February 9, 2025
Hey guys, it seems to me that in the Svelte Slider implementation the Slider always goes from 0 to 100. I can specify markers (from 0 to 100) which appear as numbers at their respective positions. I can also pass a snippet that is rendered at these positions instead, but it is constant.
I would like to pass a snippet which takes an argument (i.e. the marker value) so I can render different Icons or numbers in case I want the slider to represent something else than the numbers 0 to 100.
Currently there is no way to do that, right?
But the change in the implementation of the component would literally just be changing
...
{#each markers as value}
<!-- Mark -->
<span {...api.getMarkerProps({ value })} class="{markBase} {markText} {markOpacity} {markClasses}" data-testid="slider-mark">
{#if mark}
{@render mark()}
{:else}
{value}
{/if}
</span>
{/each}
...
to
...
{#each markers as value}
<!-- Mark -->
<span {...api.getMarkerProps({ value })} class="{markBase} {markText} {markOpacity} {markClasses}" data-testid="slider-mark">
{#if mark}
{@render mark(value)}
{:else}
{value}
{/if}
</span>
{/each}
...
Should I open a Pull request?
The text was updated successfully, but these errors were encountered:
Create a small PR in #3205
As I said there:
Not sure if there is anything else that I should do in order for this to be mergeable.
Pipelines are red. Also, I am not sure if there are any relevant docs I should update.
Sorry, this is my first time "contributing" to this project.
Let me know!
Discussed in #3201
Originally posted by Akkretion February 9, 2025
Hey guys, it seems to me that in the Svelte Slider implementation the Slider always goes from 0 to 100. I can specify markers (from 0 to 100) which appear as numbers at their respective positions. I can also pass a snippet that is rendered at these positions instead, but it is constant.
I would like to pass a snippet which takes an argument (i.e. the marker value) so I can render different Icons or numbers in case I want the slider to represent something else than the numbers 0 to 100.
Currently there is no way to do that, right?
But the change in the implementation of the component would literally just be changing
to
Should I open a Pull request?
The text was updated successfully, but these errors were encountered: