Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

If selectlist is empty, disable it #1357

Merged

Conversation

interactivellama
Copy link
Contributor

Fixes #1349 by checking to see if li are present and disabling itself if there are none or only one single item.

What's the point of selectlist with 1 item or no items?

Also implements an empty list label API:

var $selectlist = $(html).find('#selectlistEmpty').selectlist({
    emptyLabelHTML: '<li data-value=""><a href="#">I am feeling so empty</a></li>'
});

This is getting a little imperative with the emptyLabelHTML.

UPDATED: Design prefers to behave as a native select element and still allow the dropdown if only a single item exists.

@interactivellama interactivellama changed the title If selectlist is empty, disable it If selectlist is empty or a single item, disable it Jun 17, 2015
@jamin-hall
Copy link

image

@interactivellama let's try it this way.

@interactivellama
Copy link
Contributor Author

How do we want to allow the developer to create "a blank selectlist"? Right now, you can create the state by adding the empty option to the dropdown, initializing it, and then disabling it. Do we want to make this easier?

@kevinparkerson
Copy link
Contributor

We probably want a min-height on the selectlist, to ensure blank selectlists are not super tiny as well

@kevinparkerson kevinparkerson self-assigned this Jun 30, 2015
@interactivellama interactivellama changed the title If selectlist is empty or a single item, disable it If selectlist is empty, disable it Jul 6, 2015
@interactivellama interactivellama merged commit ed66d01 into ExactTarget:master Jul 6, 2015
@interactivellama interactivellama deleted the selectlist-empty branch April 4, 2016 15:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants