-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Closed
Milestone
Description
In addition to what already exists...
<div class="ui selection dropdown">
<select name="gender" data-default="Gender">
<option value="male">Male</option>
<option value="female">Female</option>
</select>
</div>
$('.ui.selection.dropdown').dropdown();
So, what happens if the first child is a select element?
- hide the select element
- insert the dropdown icon
- insert the default text if defined
- insert the items based on the text and value of each option
- watch for change events on the select element
- allow the dev to rebuild it at any time (e.g. if options change)
Benifits:
- great fallback for if a dev doesn't load jQuery and/or semantic.js
- works well with MVC, MVVM, server forms (Django, Rails, ASP, etc.)
- less code
- devs can decide criteria for making it turn into a SUI dropdown
- if A:
$('.ui.dropdown').dropdown();
- if not A: cool, it'll just be a select element
- if A: