Closed welly closed 9 years ago
Could you give me an example?
Edit: Thanks, I'm glad you like it!
SOD don't display selected option on page load if there is placeholder configured. Maybe you should add empty option on beginning of select input in this scenario (but not displayed in sod) - this reflects first empty state.
Well, @welly, it only took me 3 months. But after reading the comment from @PawelGIX I added a second placeholder option that will use the first <option>
in the select as the placeholder. Don't know if this is what you're looking for, @welly.
I think I'm seeing this issue too, if you have a placeholder set (I'm using data-placeholder) and you load a
@bryannielsen Thanks for the input. The thing is that a native <select>
always have a "selected" <option>
, even if the user haven't made a selection or there's not an <option selected>
specified. I guess the first sentence - "If you feel like adding a placeholder that's displayed before anything is selected" - in the description of the placeholder alt.1 is a bit misleading.
As I wrote in the comment above I added a second placeholder setting that fixes this issue. But then you need to prepend your <select>
with an <option>
that should be used as the placeholder.
In this fiddle you'll see an example of how both settings works. The third one is using the placeholder alt.1 setting and if you fire up the console you'll see that the first option is the one selected.
I'm closing this issue for now. Feel free to re-open if you don't feel that the second placeholder setting does the trick.
@vestman thanks! This looks perfect. Sorry I read the description for the new placeholder option but it wasn't clear to me that it would fix this issue. Looking at your fiddle and your description above I think this should solve the problem.
Thanks for the quick response and the awesome plugin!
No problem, @bryannielsen, just let me know if you have any other questions. I'm glad you like the plugin!
Fantastic widget! Thank you so much for your work on this.
I have a request, unless the functionality is there and I'm not using it correctly! When I use placeholder text, I've noticed when you submit a form, the placeholder text is showing in the select boxes rather than the selectors showing the previously selected list item. Is there a way of doing this?
Thanks!