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

Add selected class to "select all" option #262

Merged
merged 1 commit into from
Dec 16, 2015
Merged

Add selected class to "select all" option #262

merged 1 commit into from
Dec 16, 2015

Conversation

eryg-kai
Copy link
Contributor

Previously it would be applied to everything except the "select all" option, making it impossible to style the "select all" option when it was selected.

Previously it would be applied to everything _except_ the "select all" option, making it impossible to style the "select all" option when it was selected.
@eryg-kai
Copy link
Contributor Author

Are there any use cases this wouldn't work for? I feel like there must have been a reason to select on "input[selectItemName]" instead of simply "input", but I'm not sure what it is.

@wenzhixin
Copy link
Owner

Can you provide two jsfiddle(one to show the problem with the master branch, base #255, another to show the problem you fix with your changed code)?

@eryg-kai
Copy link
Contributor Author

Of course!

Here is the master branch jsfiddle and the fixed jsfiddle.

In these examples I'm just changing the color of selected options so as not to clutter up the code. But it's more visually apparent if, for example, you are using custom checkboxes and need the selected class to visually select them.

For example: master branch jsfiddle and fixed jsfiddle.

wenzhixin added a commit that referenced this pull request Dec 16, 2015
Add selected class to "select all" option
@wenzhixin wenzhixin merged commit 00f3356 into wenzhixin:master Dec 16, 2015
@wenzhixin
Copy link
Owner

Thanks for your examples!

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

Successfully merging this pull request may close these issues.

2 participants