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

Issue after removing item from list #5

Open
jschell12 opened this issue Nov 13, 2011 · 0 comments
Open

Issue after removing item from list #5

jschell12 opened this issue Nov 13, 2011 · 0 comments

Comments

@jschell12
Copy link

Just wanted to let you know that there is (or may be) a bug that prevents a user from re-selecting an option in the
"selectlist-select". When I selected an option it went into the ul list. Then I removed it but could not reselect that option unless i selected something else first. therefore I did the following to prevent this:

    var sl = jQuery("#ContentType_Edit").selectList({          
        onRemove: function(select, value, text){               
            if(jQuery(".selectlist-select").children().first().val() == ""){
               jQuery(".selectlist-select")[0].selectedIndex = 0;
            }   
        },
        instance: true,
    });
    jQuery(".selectlist-list").html("");

Also, I set a default selected item called "Please select" which will always show when the page loads. If you notice the
"jQuery(".select-list").html("");" this causes the default option to not get shown as a selected item in the ul list.

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

No branches or pull requests

1 participant