2 <ion-input> on the same IONIC 2 line

Asked

Viewed 1,014 times

0

I have a problem in my project with IONIC 2, I need to insert 2 text fields in the same line. I’ve tried to do it using , when I put only text inside it works , but when I put it it does not display.

Below is the excerpt of html I’m having problems:

    <ion-item>
      <ion-grid>
        <ion-row>
          <ion-col width-50>
            <ion-item>
              <ion-label>Minímo</ion-label>
              <ion-input type="number" [(ngModel)]="valorMinimo"></ion-input>
            </ion-item>
          </ion-col>
          <ion-col width-50>
            <ion-item>
              <ion-label>Máximo</ion-label>
              <ion-input type="number" [(ngModel)]="valorMaximo"></ion-input>
            </ion-item>
          </ion-col>
        </ion-row>
      </ion-grid>
    </ion-item>

1 answer

0


The problem was the tag ion-item out of the tag ion-grid. I just removed it and it worked:

<ion-grid>
    <ion-row>
      <ion-col width-50>
        <ion-item>
          <ion-label>Minímo</ion-label>
          <ion-input type="number" [(ngModel)]="valorMinimo"></ion-input>
        </ion-item>
      </ion-col>
      <ion-col width-50>
        <ion-item>
          <ion-label>Máximo</ion-label>
          <ion-input type="number" [(ngModel)]="valorMaximo"></ion-input>
        </ion-item>
      </ion-col>
    </ion-row>
  </ion-grid>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.