Skip to content

Commit

Permalink
Feat: Hide placeholder but keep label (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
NiclasNorin authored Aug 7, 2023
1 parent 5b19fdb commit 75a8f3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/php/Component/Select/select.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<div class="u-position--relative">
<select {!! $attribute !!}>
@if ($label)
@if ($label && empty($hidePlaceholder))
<option class="c-select__option" value="" {{ $preselected === '' ? 'selected' : '' }}>
{!! $label !!}</option>
@endif
Expand Down
2 changes: 2 additions & 0 deletions source/php/Component/Select/select.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"multiple": false,
"name": false,
"hideLabel": false,
"hidePlaceholder": false,
"size": "md"
},
"description": {
Expand All @@ -23,6 +24,7 @@
"multiple": "Sets the select box to a multiple select",
"name": "The name attribute for the select component",
"hideLabel": "Hides the label",
"hidePlaceholder": "Hides the placeholder but keeps the label",
"size": "The size of the select component (sm, md, lg)"
},
"view": "select.blade.php",
Expand Down

0 comments on commit 75a8f3d

Please sign in to comment.