Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled items in range #206

Open
ivan-zakharchuk opened this issue Dec 18, 2015 · 11 comments
Open

Disabled items in range #206

ivan-zakharchuk opened this issue Dec 18, 2015 · 11 comments

Comments

@ivan-zakharchuk
Copy link

Hi, thank for awesome angular component.

I want to ask about possibility to make some disabled elements in range, e.g. when user move through points in range some of them can be disabled and the slider should omit them in his path or if several items one by one are disabled e.g. by left side prevent possibility to move slider left. So basically I understand that I can achieve this by using some decorators or events handling, but maybe this is easy reachable out of the box and you can point me to easier solution.

Thanks for your answer.

@ivan-zakharchuk
Copy link
Author

As i see this is very close to stepsArray param, but i would be nice to expose some API(custom handler) that manage this array, or add some boolean options to supports arrays like:
[{'value': 100, disabled: true}, {'value': 300, disabled: true}, {'value': 450, disabled: false}, ... ]

@ValentinH
Copy link
Member

Indeed this would be a good feature. However, for now, it's not possible and needs quite a lot of work.
If you feel motivated to work on a PR, I can guide you but I don' think I'll do it in a near future.

@ivan-zakharchuk
Copy link
Author

Actually this feature is required in project, so I'm motivated to add this feature asap and I'll work on this PR.

I've looked on the source code and think that maybe it would be good to enable this feature by adding some
stepsArrayValue param to options which will contain string with path in case if stepsArray contain object values

e.g. for [{'value': 100, disabled: true}, {'value': 300, disabled: true}, {'value': 450, disabled: false}, ... ]
stepsArrayValue will be just 'value' and also in this case we can handle disabled param at the root of array value object. Based on those params I may modify rest depended methods.

Please let me know what do you think about this way of solution and give me hint if you feel that it can be done somehow differently.

@ValentinH
Copy link
Member

This is a good news, it's always nice to get some help! :)

I don't have much preference about the implementation, since you are the one who needs it, you know what will be the best for a use point of view.

My only requirement is to avoid as much as possible any breaking change. Thus, I'd rather prefer to keep the current stepsArray as is and create a new option for this feature. Something like stepsObjectsArray or even better: keep only one option and check internally whether stepsArray contains string or objects...

@ivan-zakharchuk
Copy link
Author

Ok, cool. Thank you for advice.

Maybe I'll ask you here again when I'll have some questions during implementation.

@ValentinH
Copy link
Member

Yes sure or you can create the PR as soon as you get a first commit so we can discuss as long as you go. ;) I'm planning to merge the quite big keyboardSupport PR this weekend so you might wait for it to avoid conflicts...

@corina10
Copy link

Hi ivanzvakoms , I would like to know if this feature will be available anytime soon.
Thank you!

maximtitovich added a commit to maximtitovich/angularjs-slider that referenced this issue Jun 14, 2017
Own implementation of disabling specific items in slider range of elements.
@maximtitovich
Copy link

Please check out my fork. I was trying to implement this thing for one of my projects. It may be not finished, could have missed somehting, when migrated to this project git. But the main idea is implemented and pretty simple.
https://github.com/maximtitovich/angularjs-slider

@ValentinH
Copy link
Member

Indeed, your implementation looks simple, that's cool!

Could you submit a PR with a demo for this? You will need to generate the dist files so the demo works (check the Contributing guide).

I have started to set a demo up but the dist files are missing : http://jsfiddle.net/nd80d23z/

@maximtitovich
Copy link

I've compiled the sources and uploaded to my repo. But seems like, my solution only works for vertical slider. Needs an improvements for any version, but now i don't have time to imlement all this for all versions.
Simple example http://jsfiddle.net/wmemf1r1/15/

@ValentinH
Copy link
Member

OK, up to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants