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

When option matches placeholder, .chosen-default should not be added #2870

Open
silverwind opened this issue Aug 23, 2017 · 2 comments
Open
Labels

Comments

@silverwind
Copy link

silverwind commented Aug 23, 2017

Steps to reproduce

  1. Open https://jsfiddle.net/silverwind/puqf4gs2/4/
  2. Select the 'placeholder' option

Expected behavior

The text in the select box should not be rendered like the placeholder, e.g. the chosen-default class should not be added, so it is possible to visually distinguish between a select element that has a option set vs. one that hasn't.

Actual behavior

The chosen-default class is added and with it, it's almost impossible to see if a item is selected (except the 'x' icon).

Environment

  • Chosen Version: 1.8.2
  • jQuery or Prototype Version: 3.2.1
  • Browser and Version: any
  • OS and Version: any

Additional information

I think the issue stems from this line, which does not distinguish between placeholder text and option text when deciding whether to add the chosen-default class:

if text is @default_text

@tjschuck tjschuck added the Bug label Aug 25, 2017
@tjschuck
Copy link
Member

Seems legit — please feel free to open a pull request to fix it if you're able and have time!

@silverwind
Copy link
Author

Fixed the jsfiddle.

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