I have an Ionic select in the same row as an input, therefore I want to show the SELECT without a label.
The code is as follows:
<ion-list>
<div class="row">
<div class="col no-padding">
<label class="item item-input">
<input placeholder="Identificación" name="identificacion" type="text" ng-click="registro.msg = null" ng-model="registro.identificacion" required>
</label>
</div>
<div class="col no-padding">
<label class="item item-input item-select" name="tipo_id" ng-model="registro.tipo_id">
<div class="input-label">G</div>
<select ng-model="registro.tipo_id">
<option ng-repeat="tipo in defaultTipo" value="{{tipo.id}}" ng-selected="{{tipo.selected}}">{{tipo.tipo}}</option>
</select>
</label>
</div>
</div>
</ion-list>
It displays as follows:
Besides the obvious difference in size (which I assume is due to the FONT SIZE of the label?).
How do I disappear the label, leaving just the input and the select?
If I delete the label:
<div class="input-label">G</div>
I get the following:
Update Thanks to Jess Patton solution:
.item-select select {
-moz-appearance: none;
position: absolute;
top: 0px;
bottom: 0px;
right: 0px;
padding: 0px 45px 0px 0px;
max-width: 100%;
border: medium none;
background: #FFF none repeat scroll 0% 0%;
color: #333;
text-indent: 0.01px;
text-overflow: "";
white-space: nowrap;
font-size: 14px;
cursor: pointer;
direction: rtl;
}
And changing the HTML to:
<label class="item item-select" name="tipo_id" ng-model="registro.tipo_id">
I get the following result:
It is much closer to the needed result, but still the difference in sizes are worrisome and not worthy for deployment.
UPDATE 2:
Changing the input padding isn't an option as it is part of a larger form.
Just remove "item-input" class and input-label part. Then, set style="max-width: 100%" to select,
Hope! It might help someone.
Here is the CSS that works for me in Ionic v1:
Think I got it, the select still works and is shown with no label. I used this html:
and this css:
Got this result:
UPDATE: I add this:
and got this:
UPDATE 2: Finally got the css right: /* Styles here */
Looks like this: