Comments (8)
Could you give me an example?
Edit: Thanks, I'm glad you like it!
from select-or-die.
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.
from select-or-die.
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.
from select-or-die.
I think I'm seeing this issue too, if you have a placeholder set (I'm using data-placeholder) and you load a element that already has a "selected" option, the placeholder is displayed instead of the selected option's value. I'm looking to see if I can figure out a workaround right now.
from select-or-die.
@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.
from select-or-die.
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.
from select-or-die.
@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!
from select-or-die.
No problem, @bryannielsen, just let me know if you have any other questions. I'm glad you like the plugin!
from select-or-die.
Related Issues (20)
- Multiple Select HOT 1
- Problems when navigating back or forward in Chrome HOT 6
- The update method does not offer any update of the config HOT 3
- Responsive styling of sod using percentages
- Selectordie not displayed correctly HOT 1
- More Callback functions HOT 1
- wasted @import font call HOT 1
- Placeholder not updating with selected option in Windows 8 (IE/Chrome) HOT 5
- Sorry for the lack of updates
- Option list in overflow hidden container issue HOT 9
- Does not work if size/data-size="5" option is added. HOT 2
- Updates
- Adding a Size breaks the drop down? HOT 1
- npm please! HOT 1
- Value not retained when selecting via sod_label.
- Multiple select elements on a single page on IOS
- Documentation is down HOT 2
- About the homepage HOT 1
- Can the plugin be made to copy over any/all data attributes in the source select options?
- Please copy the instructions from your website to the github readme file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from select-or-die.