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 select doesn't show selected value #46

Open
juhah opened this issue Oct 29, 2014 · 2 comments
Open

Disabled select doesn't show selected value #46

juhah opened this issue Oct 29, 2014 · 2 comments
Labels

Comments

@juhah
Copy link

juhah commented Oct 29, 2014

Hi,

And thanks for a nice plugin :) I noticed that a disabled select doesn't show the selected value (due to .val() returning null if the select is disabled, see: http://bugs.jquery.com/ticket/13097).

I could get this to work by replacing this line in ImagePickerOption.prototype.is_selected():

var select_value;
select_value = this.picker.select.val();

with:

var select_value, selected_index;
selected_index = this.picker.select.prop('selectedIndex');
select_value = this.picker.picker_options[selected_index].value();

Also it would be nice to get an additional class to the wrapper if select is disabled. What do you think?

Juha

@rvera
Copy link
Owner

rvera commented Mar 31, 2015

Super late reply, this sounds good. Would you mind creating a PR for this?

@juhah
Copy link
Author

juhah commented Apr 1, 2015

Pull request created: #55

@rvera rvera added the bug label Sep 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants