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

Select preset: onSelect and onChange events are triggered with disabled options #40

Closed
arleytriana opened this Issue Nov 26, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@arleytriana
Copy link
Contributor

arleytriana commented Nov 26, 2012

According to the select preset documentation, there is an “invalid” option that contains an array with the invalid values. If empty, the preset takes the disabled options from the original select element.
I am not using the invalid option and the evens are triggered.

@dioslaska

This comment has been minimized.

Copy link
Contributor

dioslaska commented Nov 26, 2012

I don't fully understand the problem.
You can make a select option disabled 2 ways:

  1. From the markup (Boston will be unselectable on the scroller):
Atlanta Berlin Boston Chicago 1. With the invalid option:

$('#city').scroller({ preset: 'select', invalid: [3]

The invalid array can contain strings or numbers, the comparision is typeless (3 == "3" - this returns true). However values are taken from the option tag's value attribute from the markup, so the wheel values are always strings. (Thanks for the docs improvement suggestion)

@arleytriana

This comment has been minimized.

Copy link
Contributor

arleytriana commented Nov 26, 2012

Thank for the clarification and you understanding.

Yes, i made the select option disabled from the markup.

If I scroll toward a disabled option, the scroll bounce to the previous option (visually), but the onChange event return the disabled one.

@dioslaska

This comment has been minimized.

Copy link
Contributor

dioslaska commented Dec 6, 2012

Fixed (on development branch)

@dioslaska dioslaska closed this Dec 6, 2012

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