Skip to content

Commit

Permalink
fix(form): add select validation styling (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan authored and hellobrian committed May 19, 2017
1 parent c2c97a5 commit fbc7bc2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/form/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
}

input[data-invalid],
textarea[data-invalid] {
textarea[data-invalid],
select[data-invalid] {
box-shadow: 0 2px 0px 0px $support-01;

~ .bx--form-requirement {
Expand Down
23 changes: 23 additions & 0 deletions src/components/form/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,29 @@
Please do not leave blank.
</div>
</div>
<div class="bx--form-item">
<label for="select-id" class="bx--label">Select</label>
<div class="bx--select">
<select data-invalid id="select-id" class="bx--select-input">
<option class="bx--select-option" disabled selected hidden>Pick an option</option>
<option class="bx--select-option" value="solong">A much longer option that is worth having around to check how text flows</option>
<optgroup class="bx--select-optgroup" label="Category 1">
<option class="bx--select-option" value="option1">Option 1</option>
<option class="bx--select-option" value="option2">Option 2</option>
</optgroup>
<optgroup class="bx--select-optgroup" label="Category 2">
<option class="bx--select-option" value="option1">Option 1</option>
<option class="bx--select-option" value="option2">Option 2</option>
</optgroup>
</select>
<div class="bx--form-requirement">
Please choose an option.
</div>
<svg class="bx--select__arrow">
<use xlink:href="/carbon-icons/bluemix-icons.svg#icon--caret--down"></use>
</svg>
</div>
</div>
<div class="bx--form-item">
<button class="bx--btn bx--btn--primary" type="button">Submit</button>
</div>

0 comments on commit fbc7bc2

Please sign in to comment.