svelte-materialify icon indicating copy to clipboard operation
svelte-materialify copied to clipboard

[Feature] Show the steps of a slider

Open avi12 opened this issue 4 years ago • 5 comments

Similarly to:

The Slider component needs to support showing the steps. This is how it's done in Vuetify.

avi12 avatar Jan 17 '21 12:01 avi12

I did not add this as I could not think of a way to also add logarithmic steps, vuetify does not use noUiSlider internally but svelte-materialify does so this can be done easily.

TheComputerM avatar Jan 17 '21 12:01 TheComputerM

You can also do some flexbox magic till this is implemented, (threw this up quickly so not as good):

<script>
	import { MaterialApp, Slider } from 'svelte-materialify';
	let value;
	const a = ['0.25', '0.5', '0.75', 'Normal', '1.25', '1.5', '1.75', '2'];
</script>

<MaterialApp>
	<div class="d-flex">
		<div class="pr-3">
			<Slider vertical min={0} max={8} step={1} bind:value />
		</div>
		<div class="d-flex flex-column">
			{#each a as i}
				<span class="text-body-2">{i}</span>
			{/each}
		</div>
	</div>
</MaterialApp>

TheComputerM avatar Jan 17 '21 12:01 TheComputerM

While it seems to work visually, I do want the user to be able to click on a label and it will move the thumb to the corresponding point, as this is the current functionality

avi12 avatar Jan 17 '21 14:01 avi12

This is hard as noUiSlider does not do this, seems we may have to implement our own slider or labels.

TheComputerM avatar Jan 17 '21 15:01 TheComputerM

I see, then in the meantime, I will revert to using Vuetify until such functionality will be implemented

avi12 avatar Jan 17 '21 16:01 avi12