2

I want the <ion-select> of a ionic form to look like a <button>.

Here is my html template:

<form (ngSubmit)="doSubmit()" [formGroup] = "myForm" >
  <ion-item>
    <!-- <button ion-button block> -->
    <ion-select type="text" formControlName="choose" placeholder = "choose">
      <ion-option value=1>option 1</ion-option>
      <ion-option value=2>option 2</ion-option>
    </ion-select>
    <!-- </button> -->
  </ion-item>
 // ... other input fields  + doSubmit() function ...
</form>

As it is, it works and I can manage the selection. But I want it to look like a button. So I added some tag <button ion-button block></button> around the <select> tags. If the <button> tags are uncommented, it does not work: It does not show as a button and the select functionnaly is dead. Also I naively expected it would execute as I had wished it, but it doesn't.

Has anyone an idea?

nyluje
  • 3,573
  • 7
  • 37
  • 67
  • Could you create a class with the button's CSS, then apply that class? – rfornal Nov 18 '16 at 20:58
  • well I thought about the CSS option, but I'd like to avoid that path. It seems cumbersome to maintain with the different button look according to platforms type. – nyluje Nov 18 '16 at 21:13

0 Answers0