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

select placeholder? #18

Open
Julix91 opened this issue Jul 5, 2017 · 2 comments
Open

select placeholder? #18

Julix91 opened this issue Jul 5, 2017 · 2 comments

Comments

@Julix91
Copy link

Julix91 commented Jul 5, 2017

This CSS code .has-float-label select:placeholder-shown:not(:focus) + * doesn't make sense to me. select can't have a placeholder attribute, it would have to be handled via a selected / disabled / hidden option. - Of course that's where the css only solution comes to the edges of what it can do - unless I'm missing something here.

https://codepen.io/Julix/pen/EXpVjz

Anyone know of a CSS way of getting the select's "placeholder" (i.e. disabled option) to display the label (and not when other things are selected)? -- Else, what's a simple js solution for this?

@tonystar
Copy link
Collaborator

tonystar commented Jul 6, 2017

That's right. <select> support is limited.

My suggestion is to toggle some .placeholder-shown class for <select> fields via JS => that should allow to reuse the same styling.

@Julix91
Copy link
Author

Julix91 commented Jul 20, 2017

That's not a bad idea. Guess that's what JS is for, right? :)

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

2 participants