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

defaultText option now seems to be ignored #37

Open
daveworth opened this issue Apr 18, 2012 · 0 comments
Open

defaultText option now seems to be ignored #37

daveworth opened this issue Apr 18, 2012 · 0 comments

Comments

@daveworth
Copy link

In previous versions of StylishSelect, in particular 0.4.1, the defaultText parameter was respected, but no longer appears to be. I've created a Gist, copied from the included index.html to demonstrate. I attempted to debug and it appears that the default options, followed by the merged options, are overridden when the selected attribute is fetched from select element in the DOM.

As I understand it the selected element (the attribute of the form <option selected="selected" value="foo">Text!</option>) is meant to be the only element that overrides defaultText but it appears that elements selected at DOM ready time are viewed as selected which throws this off. I attempted a patch but could not fixup lines 125-128 since the first element .is(":selected") returns true if there is no selected="selected" element in the options list.

Is there another means of determining if the DOM actually contains an explicitly selected element in a select's options list? If so can we patch this up to respect defaultText?

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