ngx-slider icon indicating copy to clipboard operation
ngx-slider copied to clipboard

Feature Request : Is there a possibility to disable only few ticks in a slider ?

Open Sindhu-Shekar opened this issue 2 years ago • 5 comments

Requirement : Possibility to disable only few ticks in a slider, and not the entire slider

Approach : I tried to hide the ticks via css and also specify 'pointer events : none'. Even though the ticks aren't visible, if i click on it's position, the slider pointer moves

Any suggestion/help appreciated

Thank you !

Sindhu-Shekar avatar Mar 16 '22 08:03 Sindhu-Shekar

There is an option called "ticksArray". It takes an array of numbers. These numbers are indexes of the values of the stepsArray against which you to show ticks. Using this array you will be able to show selective ticks.

haadbaig avatar Sep 18 '23 08:09 haadbaig

@haadbaig Hey Haad, I need to add minor ticks. Is there a way I can show them?

usamasharif avatar Oct 31 '23 20:10 usamasharif

HI Usman, Can you please explain what do you mean by minor ticks?

haadbaig avatar Nov 01 '23 05:11 haadbaig

@haadbaig I need slider to look like this. Please check this screenshot for your reference. As you can see there are ticks, bigger one are called major ticks and smaller one are called minor ticks. I'm able to show major ticks but can't see how I can show minor ticks. Screenshot 2023-11-01 at 11 20 51 AM

usamasharif avatar Nov 01 '23 06:11 usamasharif

Unfortunately, there is not such option in my knowledge that would allow dynamic resizing of the slider ticks. However this can be achieve by manually adding underscores in the stepsArray like this:

stepsArray: [ { value: 10, legend: '-- 10' },stepsArray: [ { value: 20, legend: '- 20' }, ....

By doing this and adjusting sum : :deep CSS of the ticks, I believe, this is a workaround that can work in this case.

Incase you find any other solution for this, enlighten me as well.

haadbaig avatar Nov 01 '23 06:11 haadbaig